Community Profile

# Chunru

Last seen: Today Con actividad desde 2013

Matlab user since 1990

All

Ver insignias

#### Content Feed

Ver por

Respondida
Finding a definite integral
Assuming that u and k are constant vectors: u = randn(1, 100); k = randn(1, 100); syms x f = (u+k)*int(1.5*exp(-2*(1-x)), ...

alrededor de 3 horas hace | 0

Respondida
I need help with this code
figure; facesColor = {[1 0.5 0], [1 1 1], [1 0 0], [1 1 0], [0 0 1], [0 1 0]}; acesVertices(:,:,1) = [0 0 0; 1 0 0; 1 1 0;...

alrededor de 5 horas hace | 0

Respondida
Speed of the abs function
" squaring was a expensive operation" This is ture for VERY OLD cpu or some special purpose CPUs. In modern general purpose CP...

alrededor de 7 horas hace | 2

Respondida
How to draw a 3D surface with all the given discrete points？
load(websave("XYZ_data.mat", "https://www.mathworks.com/matlabcentral/answers/uploaded_files/1559554/XYZ_data.mat")) whos figu...

1 día hace | 0

Respondida
polar data 3d plot
r = linspace(0,100, 101)'; theta = linspace(0, 360, 61); t = 1; % single t point for simplicity here u = 1./r.*cos(2*pi*.05...

1 día hace | 0

Respondida
How do I get this plot in Matlab?
% Define the general solution % [2 -1] and [1 2] are vectors. Use [ ]. X_general = @(t, c1, c2) (c1 * [2 -1] .* exp(-t)+ c2 *...

1 día hace | 0

Respondida
Plotting a curve using two interdependent intervals
You need array division ./ instead of / v=0:373; td=0.5; ts=0.2; g=9.81; a=0; p=1.204; cx=0.35; cz=-0.05; ax=1.77; m=1240; u=1...

4 días hace | 0

Respondida
Generate specific binary combination
You can put the dec2bin inside the loop so it won't be a big array. N = 4; for i=0:2^N-1 c = dec2bin(i, N) - '0' end

5 días hace | 1

Respondida
why the real matrix becomes complex number when transfered to cell
You won't get complex output if FD is real. Check type of FD. S=15; %smaller N=6; FD = rand(N*S, S); FY=cell(S,S) f...

6 días hace | 0

Respondida
How can I use various colors to fill the area under a normal distribution curve?
data = randn(8192, 1); h = histfit(data); pd = fitdist(data,'Normal') figure; x = linspace(-4*pd.sigma, 4*pd.sigma, 1001);...

7 días hace | 1

Respondida
problem of using findpeaks
load(websave("19year.mat", "https://www.mathworks.com/matlabcentral/answers/uploaded_files/1553817/19year.mat")) % It seems tha...

7 días hace | 1

Respondida
pdeplot with same colorbar range
Use clim for each subplot. figure; subplot(3,1,1) pdeplot(model,"XYData",u(:,1),"Contour","on", "ColorMap","jet") clim([0 76...

7 días hace | 0

| aceptada

Respondida
issues with making a matlab firfilter
%[x, fs] = audioread('SunshineSquare.wav'); load handel.mat audiowrite("handel.wav", y, Fs); [x, fs] = audioread('handel...

8 días hace | 0

Respondida
how to use writetable for one sheet?
inputData = [0.001 0.1; 0.003 0.1; 0.006 0.1; 0.1 0.09; 0.3 0.08; 0.5 0.07; 5 0.01; 7 0.005; ...

8 días hace | 1

| aceptada

Respondida
How to store each iteration of a loop as it's own varible.
syms k h g_dot T_inf L delta_x %symbolic varibles. T = sym('t',[8,1]); EQ = sym('eqn',[8,1]); n = 8; %for i = n-(n-1):1:n ...

8 días hace | 0

| aceptada

Respondida
how to get real frequency components using MUSIC compute frequency?
rng default n = 0:199; f1 = 0.257/2; f2 = 0.2/2; fs= 2; % fs (fs>2*max(f1, f2) % generate signal according to f1...

8 días hace | 0

Respondida
A problem with xtick
It works here without problem. S=load(websave("LandauData.mat", "https://www.mathworks.com/matlabcentral/answers/uploaded_files...

11 días hace | 0

| aceptada

Respondida
How to plot specified data points on a polar plot with curved lines, instead of straight lines
c_2 = [780.980150003248 900.818303825083 956.494860478838 855.216748671708 999.328305026861 784.311636929536 806.164595552563] ...

12 días hace | 0

Respondida
How to write a diagonal rectangular matrix
You can use toeplitz function. % Smaller n, m here n = 10; m = 8; A = diag(21*ones(n,1)) + diag(-4*ones(n-1,1),-1)... ...

12 días hace | 0

| aceptada

Respondida
Bode plot of individual poles and zeros
z = 1000; p = [10 10 100]; k = 200; bode(zpk(z, p, k), 'k'); hold on for i=1:length(z) bode(zpk(z(i), [], 1/z(i)), ...

12 días hace | 0

Respondida
How can I plot multiple signals in a single plot? Please give me suggestions which functions have used for this.
% Generate som data fs = 1000; t=(0:1/fs:1)'; f = 10:10:40; x = sin(2*pi*t*f); x = x + 0.1*randn(size(x)); n = size(x, 2)...

12 días hace | 0

| aceptada

Respondida
How to retrieve data from a Excel sheet saved at a particular location in pc?
You need to provide the extension name (.xlsx ?) to the file.

13 días hace | 0

| aceptada

Respondida
How do you output both variable values and names in a function?
You can consider to use struct which has field names. t = Epoch_calc(20231121) function t = Epoch_calc(recorded_date) %EPOCH_...

14 días hace | 0

Respondida
I have an Excel sheet with headers of different depths and the numbers are not being read (ex.: d=-12.82m is being read as x_12_82M),
% The first row is treated as var names. Use preserve to keep the original % format a = readtable("https://www.mathworks.com/...

15 días hace | 1

| aceptada

Respondida
How do I form a matrix from an array of rows and columns
A=ones(10); a=[1 3 5 6 9]; b=[1 2 4 7 9]; A(sub2ind(size(A), a,b)) = 0; A

16 días hace | 1

| aceptada

Respondida
how to create shape on xy surface?
websave("variable.mat", "https://www.mathworks.com/matlabcentral/answers/uploaded_files/1538662/variable.mat"); S = load('varia...

18 días hace | 0

| aceptada

Respondida
How to create a pulsing sound/use duty cycle
It seems that nSeconds should be 0.5s. Each pause should be also 0.5s. Thus it repeats 60 time in a min. Fs = 8000; %# S...

20 días hace | 0

| aceptada

Respondida
Need Help with FFT Analysis and Power Factor Calculation in MATLAB
Here is the work flow: 1.Read the CSV data in MATLAB with the "t" and "i(t)" column header as a table x = readtable("https:/...

21 días hace | 0

Respondida
Can I access the code for my packaged app?
Perhaps the most straightforward way is to convert your m-code to pcode (doc pcode for more details). Compiling is another optio...

21 días hace | 1

| aceptada

Respondida
I would like to create an array to store a password, website combo.
Use string array instead of cell array for efficiency. You can also considre to use table. pa = ["abc", "def"] pa = addPasswo...

21 días hace | 0