Answered
how to store the conditional loop data
If I understand the code correctly, it can be simply stated as: ut=rand(15,1); u_y=([0.84;0.384;0.784]); U_y = [u_y;u_y;u_y;...

4 years ago | 1

| accepted

Answered
How to graph this text file
The ‘A’ variable is actually the assigned file identification number, always a scalar. It us used to refer to the file using fs...

4 years ago | 0

| accepted

Answered
How to import information from an excel file with many spreadsheets
The ‘data’ output needs to be saved as a cell array for each value of ‘i’. Try something like this — num_sheets = 24; for ...

4 years ago | 0

Answered
How to interpolate the given plot?
MATLAB reads what it is given. %step 0 Qi = readmatrix("JD_PM sampleData30mm.csv"); [v,w] = size(Qi); %step 1 fCom_004 = ...

4 years ago | 1

| accepted

Answered
I am getting a "Index exceeds the number of array elements (1)." error
I have no idea what size ‘A’ is, however the sum of one element of a matrix or vector is simply that element. If the sum ca...

4 years ago | 0

| accepted

Answered
Fopen returning "Unable to find file. Ensure file exists and path is valid"
I am not certain what the problem is. Try this — currentdate = string(datetime('now', 'Format','dd/MM/yyyy')); %converst ti...

4 years ago | 0

| accepted

Answered
ODE code is not working
Problem: [VF, Subs] = OdeToVectorField ([Ode1, Ode2,Ode3]); ↑ Try this — syms X(t) Y(t) Z(t) YF alpha beta ga...

4 years ago | 0

Answered
Smaller frequency bins after FFT for PPG signal
For a one-sided fft, the frequency vector will extend from 0 Hz (DC) to 12.5 Hz (Nyquist frequency) for your signal. The length...

4 years ago | 2

| accepted

Answered
Smallest interval in array
I am not certain what the desired result is here. Try this — T1 = readtable('https://www.mathworks.com/matlabcentral/answer...

4 years ago | 0

| accepted

Answered
Need to implement a parameter that grows at a specific rate over time
Perhaps this — G0 = 2; I0 = 0.3; Gfcn = @(t,G,I) G.*(1+I).^t; t = linspace(0,5, 25); figure plot(t, Gfcn(t,G0,I0)) g...

4 years ago | 0

Answered
How to set a string as a CODE in script file?
I am not certain what you are actually asking. If you want the user to enter specific values and assign them in the code to s...

4 years ago | 0

Answered
3D plot using time series
results = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/980365/results.xlsx', 'VariableNamingRule'...

4 years ago | 0

| accepted

Answered
How to campare signals with different length?
One option may be the Signal Processing Toolbox findsignal function (introduced in R2016b). The signal lengths are not importan...

4 years ago | 2

| accepted

Answered
Free molecular diffusion following Fick's first law in 2D plane.
The pdepe function might be appropriate.

4 years ago | 0

| accepted

Answered
How do I get an output in vector form of (h,m)
It is not certain what you want or what size ‘data’ is. If ‘PumpA’ and ‘PumpB’ are always assigned scalars in each iteration, t...

4 years ago | 0

Answered
Reverse the values shown on a colorbar
Use flipud on the colormap — [X,Y,Z] = sphere(50); Z = Z*20 + 290; figure surfc(X, Y, Z, 'EdgeColor','none') colormap(gr...

4 years ago | 1

| accepted

Answered
How to extract signal segments from a long signal given each segment's start and end points
Perhaps — First load ‘Time’ and ‘combinedAccel_01’ and ‘ROILimits’ into the workspace. Then extract them to a cell array: ...

4 years ago | 1

| accepted

Answered
Improve a scattering plot: How to make it clearer?
The LaTeX tick labels simply require specifying TickLabelInterpreter = 'latex' — xlabel('$$a$$', 'Interpreter','latex'); yla...

4 years ago | 0

| accepted

Answered
fft question about data length and spline data
If you have R2016b or later, the fillmissing function will likely be a better choice.

4 years ago | 0

Answered
Trying to find the min non-zero value of a [925x902] matrix
Perhaps — D1.Z = rand(925,902) % Create Test Matrix D1.Z(randi(numel(D1.Z),1,5)) = 0; ...

4 years ago | 0

| accepted

Answered
how can I plot a bode plot of transfer function that has one variable that changes the frequency response?
Perhaps something like this — R = 1E+3; C = 1E-6; % L = 1E-3; s = tf('s'); H = @(L) 1 / (R + L*s + 1/(C*s)); ...

4 years ago | 1

| accepted

Answered
I would like to take the inverse laplace transform of a transfer function.
The Control System Toolbox tf objects cannot directly be used as symbolic objects. So it has to be re-defined as a symbolic fra...

4 years ago | 1

| accepted

Answered
Using the fsolve command to find Turning Points from Jacobian Matrix
Perhaps — syms x y f(x,y)= x^(2-x^(0.5))+y^(2-y^(0.5)) J = jacobian(f) Jfcn = matlabFunction(J, 'Vars',{[x,y]}) format ...

4 years ago | 1

| accepted

Answered
using nonlinearmodek fit for the first time
The NonLinearModel is a class. To do the actual nonlinear regression, use the fitnlm function.

4 years ago | 0

Answered
Integration containing multiple variable and plotting
To use vectors as arguments in the integrand, it is necessary to use integral and the 'ArrayValued',true name-value pair — % ...

4 years ago | 1

| accepted

Answered
STuck at coding second order differential equation (mx"+cx'+kx=f0coswt)
Refer to the ‘num_for’ function as a function handle. Quoted character arays ar not longer recognised. Tspan=[0 10]; y0=[...

4 years ago | 1

Answered
numerical integration using trap()
Since ‘filtered’ is apparently a matrix, perhaps — filtered = randn(10,10); %1.Moment [row,column] = size(filtered); x=1:...

4 years ago | 0

Answered
Graphing region of intersection
In your original earlier post the cylinders were described differently. Using that definition, I would do something like this...

4 years ago | 0

| accepted

Answered
Calculating mean of signal between certain time interval in a loop.
It is not possible to do anything with an image of data. Simulating it — t = linspace(0, 20); s = ((1 - exp(-1.5*t)) + 0.5...

4 years ago | 0

| accepted

Answered
plotting shaded area of integral
The function creates a surface, and the integral has only a scalar value, so perhaps something like this — F = @(x,y) y.*sqrt(...

4 years ago | 0

| accepted

Load more