Answered
I am trying to write formulas involving specific values from the table by quoting specific row and column names
You appear to have imported the file correctly with readtable. All readtable is telling you in the Warning is that it had to cr...

7 years ago | 0

Answered
How to change the ylim for all histogram figures after a for loop?
I can’t run your code (no data), so I simulated it. This seems to work: for k = 1:12 figure(k) H = histogram(rand...

7 years ago | 1

| accepted

Answered
Finding average step size and slope with ode45
Subscript ‘dT’ as well. The code will be more efficient if you move the plot outside the loop: t = [0, 5]; % time span y0...

7 years ago | 0

| accepted

Answered
How to save ode45 outputs in a loop?
The easiest way would be to save them as cella rrays, then sort those out later: for j = 1:7 [T{j},Y{j}] = ode45(dydt, t,...

7 years ago | 0

| accepted

Answered
Genetic Algorithm chart convergency
It does converge to the best fitness value. The ga algorithm will keep searching for the best fitness value until it reaches wh...

7 years ago | 0

| accepted

Answered
Laplace of Constant a
You must tell the laplace function what the independent variable and transformation variable are. It has no way of knowing, oth...

7 years ago | 4

| accepted

Answered
How can I design flat magnitude response IIR filter ?
I am not certain what you want the filter to do. One option is to design a lowpass filter with a cutoff near the Nyquist freque...

7 years ago | 0

Answered
Missing plot line and legend mismatch
Note that ‘By’ is a scalar, so it actually will not appear on the plot (unless you plot it with a marker). They will all plot a...

7 years ago | 1

| accepted

Answered
Using rows of matrix as elements in a new matrix.
Try this: M = [1:12; rand(1,12)]; % Original Matrix n = 50; xnew = linspace(min(...

7 years ago | 0

Answered
Polyfit not showing a curve
You aren’t finished evaluating the fit. You need to use polyval to evaluate it. Try this: % store coordinates x = [5.2 5....

7 years ago | 0

| accepted

Answered
discrete low pass in an array
You willl first need to use the resample function to create uniform sampling intervals for your data. Then there are any number...

7 years ago | 1

| accepted

Answered
Interp1 returns NaN for a value
You could have NaN values in your data. If so, first use the fillmissing function (R2016b and later reseases), then interp1.

7 years ago | 1

Answered
Fourier Series Expansion Graph Help
If you want to plot them beginning at 0, remember to tell fplot: figure fplot(s,[0 L]) hold on fplot(f,[0 L]) That will s...

7 years ago | 0

| accepted

Answered
problem while using 'intersect' between strings
The letter ‘l’ appears twice in both strings, so is only returned once in the intersect result. Yopu will get a similar resul...

7 years ago | 0

| accepted

Answered
How to change the legend color?
First, create a handle to the legend object, then change whatever properties you want using the options in Legend Properties. ...

7 years ago | 0

| accepted

Answered
I need help with this
See the documentation section on Data Import and Export and Data Import and Analysis.

7 years ago | 1

Answered
"Busy" in command window, doesn't respond
This occurs with large data sets, infinite loops, or slowly-converging optimizations. The first option is to use CRTL+C to in...

7 years ago | 2

| accepted

Answered
How to use ode45 on a second-order ODE, but without a function file (just one script)?
You are almost there! Try this: dydt = @(t,y) [y(2); eps*((y(1)^2) - 1)*y(2) - y(1)]; ic = [1 1]*eps; tspan = [0 10]; ...

7 years ago | 0

| accepted

Answered
Finding change in a large dataset
The ischange function needs to be told what you want it to do. D = load('Kdata.mat'); y = D.rel_P_set_200; x = 1:numel(y); ...

7 years ago | 0

Answered
How do I make gaps in missing data plot lines?
It would be easier with your data. One option is to fill the missing entries with NaN values: x = [1:10 15:20]; ...

7 years ago | 0

| accepted

Answered
How can plot individual mode shapes of a cantilever beam with a tip mass?
You need to use element-wise operations (.* for element-wise multiplication instead of * that is used for matrix multiplication)...

7 years ago | 1

Answered
For loop for multiple arrays
If you want ‘x’ to be the sum of the columns of the three vectors, try this: a = [1 2 3 4]; b = [5 6 7 8]; c = [9 10 11 12...

7 years ago | 0

| accepted

Answered
I have in trouble with my codes.. help!
You increment ‘k’ in the loop, however only ‘C(1)’ exists, not ‘C(2)’ or any beyond that. That is the problem. I have no ide...

7 years ago | 0

| accepted

Answered
projection of 3D plot onto 2D.
You can change the transparency ('FaceAlpha') of the surf plot. The problem is that the line is white, so even with a very low ...

7 years ago | 0

| accepted

Answered
solving for a single unknown
One approach: mve_fcn = @(theta,mve) 2./pi.*atan((c1*cos(u.*theta)+c2.*cos(t.*theta)+d1.*cos(y.*theta)+d2.*cos(x.*theta))./(a1...

7 years ago | 1

| accepted

Answered
how to write a formula in matlab including different variation
First: A = exp(pi/3)*r./x; % Statement A = @(r) exp(pi/3)*r./x; % ...

7 years ago | 0

| accepted

Answered
plotting two parametric functions in same figure
You are not doing anything wrong, you are simply misinterpreting the results. The first function would plot with ‘t’ on the x-a...

7 years ago | 0

Answered
mathematical relation with signals parameters
Some of those are related and interdependent, for example ‘acceleration’ (that I assume means ‘slope’ of the waveform), amplitud...

7 years ago | 0

| accepted

Answered
plot(x,y(1,:) meaning
It means the first row of the ‘y’ matrix. See Matrix Indexing for details. EDIT — To illustrate: y = [1 2 3 4 5; 6 7 8...

7 years ago | 0

Answered
Mininum value of array is showing right magnitude but wrong position
Probably the only way you can get around that is to set the values you want to exclude to NaN: w = [3 2 0 1]; w(w<=0) = NaN; ...

7 years ago | 0

| accepted

Load more