Answered
How to fix black figure error?
Use the image (link) function instead. It will give you: There are other options as well, such as surf, mesh, and contourf....

8 years ago | 0

| accepted

Answered
How to fill a zeros matrix with text?
I am not certain what you are doing. The string (link) variable type (introduced in R2016b), may do what you want.

8 years ago | 0

Answered
Plotting histogram with increments
I am not certain what you are asking. You can easily specify the bin edges in the histogram (link) function. From the docume...

8 years ago | 2

| accepted

Answered
How to solve a system of two equations with 3 unknowns??
I would do it the same way I would do it in secondary-school algebra: syms x y z Eq1 = x+3*y-2*z == 7 ...

8 years ago | 0

Answered
Shade below a graph above certain value
Yopu did not choose to share the data that created ‘p’ and ‘q’, so I created my own functions to test this code: p = linspace(...

8 years ago | 0

| accepted

Answered
How can I repeat the following process for another 199 random matrices?
Without knowing the sizes (row and column dimensions) of the results of your functions, I would default to storing them in cell ...

8 years ago | 0

Answered
ODE Solver wont input P1 function
Since ‘rhs’ is a function nested inside ‘first_oder_ode’, it will inherit all the variables in the ‘first_oder_ode’ workspace. ...

8 years ago | 1

| accepted

Answered
Problem turning array vectors into a table
You’re not concatenating ‘D’ and ‘R’ correctly to create ‘C’, and your second fprintf statement will only print out one column, ...

8 years ago | 0

Answered
Finding intersection of plotted dataset and line
One approach: x = 0:20; % Create Data y1 = 15 - 3*x; ...

8 years ago | 0

Answered
Solving a nonlinear ODE with derivative squared
One approach: syms a b c d y(t) T Y Dy = diff(y); DE = a*Dy^2 + b*Dy + c*y == d; isoDE = isolate(DE,Dy) [VF,Sbs] = odeToVe...

8 years ago | 0

| accepted

Answered
Why wont my plot graph a line?
You need to completely vectorise your expressions and equations, specifically using element-wise operations (note the use of the...

8 years ago | 1

| accepted

Answered
Cubic Spline Interpolation of a 3D surface Plot with Datetick Axis Labels
See if this works in your application: simulatedTime = [34630:34929, 34630:34929]; simulatedZ = 350 + 250*rand(600, 1); simu...

8 years ago | 0

| accepted

Answered
How to solve this error for the calculation of PVmax2? : Array indices must be positive integers or logical values.
My guess is that you’re missing an operator (possibly a ‘*’ for multiplication) here (note ↑): PVmax1 = (0.5 * row * Cd * Af *...

8 years ago | 0

| accepted

Answered
Add colon in between 6 digit numbers to represent time
One approach: Time = 134911; Tr = [fix(Time/1E+4) fix(Time/1E+2)-1E+2*fix(Time/1E+4) rem(Time, 1E+2)]; Tstr = sprintf('%02d:...

8 years ago | 0

| accepted

Answered
Matrix dimension must agree
The problem is the way you define ‘C’. MATLAB interprets this as going from 10 to 50E-6 in steps of 10. It never iterates at a...

8 years ago | 0

| accepted

Answered
Fourier Sine code simplified to solve this problem and plot
You can do this symbolically just as the problem is written: syms t omega f(t) f(t) = sin(t); Fourier = int(f*exp(1j*omega*...

8 years ago | 0

Answered
Fzero, Function value at starting guess must be finite and real.
This runs without error, although it does not appear to change the initial parameter estimates during the optimisation: % % ...

8 years ago | 0

| accepted

Answered
How do I extract multiple numbers from a string or character vector?
Try this: time_taken_pre_char = {'7 mins 12 secs' '12 mins 54 secs' '1 min 1...

8 years ago | 0

| accepted

Answered
How to draw a arc with arc length and angle
My approach is a bit different: r = 125; % set the rad of arc is 125m l = 180; % set the length of arc is 180m crcm = 2*pi*...

8 years ago | 1

Answered
Numerical integration of the solution of a system of differential equations (SIR model)
‘Int 2 is the trapz method, the plot doesnt show anything at all (figure 3)’ That is because ‘Int2’ is a scalar. You can plo...

8 years ago | 0

Answered
How to obtain Fourier power spectrum of velocity data?
See if the pwelch (link) function will do what you want. It may also not show any specific frequency peaks (it tends to combine...

8 years ago | 0

| accepted

Answered
hwo can i solve matlab error in this code
You are using the inverse of the function you want. Try this: [maxr, maxc] = ind2sub(std, maxidx); The max function return...

8 years ago | 0

| accepted

Answered
Non-uniform axis spacing in a plot
Try this: x = 10.^(rand( 1, 20)*3); % Create Data y = rand(1, 20); ...

8 years ago | 1

Answered
How to switch an element in matrix at for example (4,10) to be at (10,4)
Try this: M = randi(9, 4, 5) % Create Matrix R = 2; % O...

8 years ago | 0

Answered
Log scale for radius axis in a polar plot
Try this: th = linspace(0, 2*pi, 9); % Create Angles r = rand(1, numel(th)) .* 10.^(...

8 years ago | 1

| accepted

Answered
How to find parameters of binomial distribution?
If you have the Statsitics and Machine Learning Toolbox, see if the binofit (link) function will do what you want.

8 years ago | 0

| accepted

Answered
fminbnd not working for storing values in array.
There are two errors. The first is with respect to your needing to vectorise your ‘Drag’ function, and this will work: Drag ...

8 years ago | 0

Answered
I have a problem with this ode45
Could the problem be in or related to ‘fun_q’ that you have not posted? It would likely help if you posted it.

8 years ago | 0

| accepted

Answered
How to Apply FFT on CVS file.
This will get you started: [D,S] = xlsread('dry pump_6h data_acceleration.csv'); t = D(:,1); Accel = D(:,2:end); Ts = mean(...

8 years ago | 0

| accepted

Answered
Discrete Fourier transform of Time series
See the documentation on fft (link), and the documentation on lowpass (link). (The lowpass function was introduced in R2018a.)

8 years ago | 0

Load more