Answered
Plotting a function given a range of inputs
One possibility: x = linspace(2, 20, 25); y = 8*x + 10; figure(1) plot(x, y, '-pg') grid xlabel('x') ...

8 years ago | 0

Answered
How to build this vector?
I hope this is not a homework assignment. N = 10; V1 = zeros(N, 2); V1(:,1) = 1:N; V1(:,2) = 1-1./V1(:,1);

8 years ago | 1

| accepted

Answered
Hello! I have x,y and z data (they are column matrices) and I need to plot a contour.
*_‘What should I do?’_* First, look at your data. If they are gridded, you only need to use the *|reshape|* function to cr...

8 years ago | 0

Answered
Linear Regression, two matrices 1st(82x1), 2nd(82x7). ERROR
There are several problems: *|1.|* Your function is actually *_non_*-linear. In regressions, ‘linearity’ is defined with ...

8 years ago | 1

| accepted

Answered
changing command form old version to new version of matlab
The <https://www.mathworks.com/help/matlab/ref/audioread.html *|audioread|*> (link) function should do what you want.

8 years ago | 0

Answered
how to plot a matrix with vector ??
Depending on what you want, one of these will work: A=[ 1 2 3 ; 4 5 6; 7 8 9]; B=1:3; figure(1) plot(B, A) ...

8 years ago | 0

| accepted

Answered
How can I change value in a table?
One approach: d={'first';'second';'third';'forth'}; L=[2;35;4;65]; T=table(d,L) idx = find(L == 35); T.L(i...

8 years ago | 2

Answered
How to add column values of different tables based on dates column
If you have *|R2016b|* or later, either the <https://www.mathworks.com/help/matlab/ref/retime.html *|retime|*> (link) or <ww.mat...

8 years ago | 0

| accepted

Answered
How to convert numbers in the form yyyymm to dates in the form mm/dd/yyyy
Try this: numerical_dates = 192604 : 192609; dates = datetime(fix(numerical_dates/100),rem(numerical_dates,100), ones(s...

8 years ago | 0

| accepted

Answered
RMSE between two variables
UPDATE: Starting in R2022b, you can now calculate Root Mean Square Error using the built in MATLAB function ‘rmse’: https://www...

8 years ago | 5

| accepted

Answered
How to shift the columns and rows with variables?
I do not have your data so I cannot offer a solution specific to it. See if something like this does what you want: R...

8 years ago | 0

| accepted

Answered
how can i get 90 degree view of an 2d image?
For *|3D|* _plots_, such as *|surf|*, adding: view(90, 0) works. Most images in MATLAB are planar, so I doubt that wou...

8 years ago | 0

Answered
how can i take common z in this ztransform
If you are using the Control System Toolbox, the *|'Variable'|* name-value pair will control how *|‘z’|* appears. *_Example...

8 years ago | 1

Answered
How do i combine 2 functions into 1 graph
I am not certain what you want. Try this: passiveinoutwithnumberofpumps = @(Np, D, Ao, y, x, s, t) Np*(D*((Ao-y)/x)*s...

8 years ago | 0

Answered
Display all while loop outputs into a chart?
You need to subscript them and save them as vectors: Balance = 6000; Year = 0; k = 1; while (Balance < 12000) ...

8 years ago | 0

Answered
Subscripted assignment dimension mismatch in the "SampEnMLAUC(i_files)= cumtrapz(sampEn_ML);" line
Since it is not possible to determine from the code you posted whether the result of your *|cumtrapz|* calls are row or column v...

8 years ago | 0

| accepted

Answered
Why wont this script plot a graph? the plot shows up empty on the interval 0 - .9, 0 - 1
Change your current *|plot|* calls to: plot(x,y,'p')

8 years ago | 2

| accepted

Answered
Sine curve fit to data with a fixed period
This works, and doesn’t use the Curve Fitting Toolbox: <http://www.mathworks.com/matlabcentral/answers/121579-curve-fitting-to-a...

8 years ago | 1

| accepted

Answered
What does the following MATLAB code do?
It takes *|‘x’|*, raises it to the *|‘n’|*-th power, adds *|‘delta’|* to it, then rounds that result toward zero, divides that r...

8 years ago | 1

| accepted

Answered
How can i plot the magnitude and phase response for given output?
First, code the function you posted an image of. It would be best to create it as a transfer function object, using the *|tf|* ...

9 years ago | 0

| accepted

Answered
Problem reading excel data, unknown format
It’s not a ‘normal’ space *|(char(32))|*. It’s a ‘nonbreaking’ space, *|(char(160))|*. Use *|strrep|* to replace it with a...

9 years ago | 0

| accepted

Answered
Error: GA function - Too many output arguments
There are several problems with your code, not the least of which is your invoking the Symbolic Math Toolbox that is inappropria...

9 years ago | 0

| accepted

Answered
State Space Modelling in MATLAB
You are describing a discrete-time state space model, so see the Control System Toolbox <https://www.mathworks.com/help/control/...

9 years ago | 0

Answered
Very simple question relating to symbolic matrix rotations
Use the <https://www.mathworks.com/help/symbolic/subs.html *|subs|*> (link) funciton.

9 years ago | 1

Answered
HELP ME PLEASE! How to find parameter estimation with fminsearch? And solve it with ode45? Why it always error when i run my codes?
This runs. You can run it as posted if you wrap all of this code in a *|function|* (rather than a script). Remember that t...

9 years ago | 0

| accepted

Answered
Solve a system of equations
These may provide you with an approach appropriate to your problem: * <http://www.mathworks.com/matlabcentral/answers/43439-...

9 years ago | 0

| accepted

Answered
Synchronize two time series matlab R2015a
Try this: [D1,S1,R1] = xlsread('SP dated.xls'); [D2,S2,R2] = xlsread('CAC40 dated.xls'); S1ds = R1(2:end,:); ...

9 years ago | 0

| accepted

Answered
3D surface plot from imported 2D excel array
Try this: [D,S,R] = xlsread('ExampleArray.xls'); figure(1) ribbon(D(:,1), D(:,2:end)) grid on [X,Y] = ...

9 years ago | 1

| accepted

Answered
Eventually want to plot H(2) vs f but H(2) only gives [1,1,1,1,1]
Try this: %Defining resistance and capacitance R = [1 10 100 1000 10000]; C = [200 500 2000 4000 9000]; f = logsp...

9 years ago | 0

Load more