Answered
Undefined operator '-' for input arguments of type 'cell'.
The reason it is not possible to do mathematical operations on cell arrays is that cell arrays can contain anything, including s...

9 years ago | 0

| accepted

Answered
Error using TF (Transfer Function): Too many output arguments.
_‘Regardless, the code does not allow any sort of mathematical operation (+,-,*,/) on the 's' tf variable.’_ True. See t...

9 years ago | 0

Answered
Confidence intervals interpretation help
The confidence intervals correspond to: (Intercept) 10.035 8.7784 11.2919 x1 -2.3583 -...

9 years ago | 0

Answered
Least square fitting of data
Do this: xdata = [2;10;20;30;40;50;60;70;80;90;99.598]; ydata = [98913.08;19922.26;10046.06;6751.64;5107.10;4116.99;345...

9 years ago | 0

| accepted

Answered
How to plot a 3D graph
Use *|meshgrid|* to create matrices for *|‘t’|* and *|‘T’|*, and remove the subscripts from the *|‘Y_B’|* calculation: T=6...

9 years ago | 0

| accepted

Answered
Index exceeds matrix dimensions. vmw = sqrt((y(2)-Wx)^2 +(y(4)-Wy)^2 +(y(6)-Wz)^2); plz help to solve this problem.
You need to pass the time and dependent vector arguments to your function, so the *|function|* declaration must be: functi...

9 years ago | 0

Answered
why is my figure not showing data?
You need to subscript *|‘Cp’|* and *|‘lambda’|*. This works: while Uo < 30 % can be changed Pe = ((omega^2)*(...

9 years ago | 0

Answered
Unsual gradient from gradient
The *|vpa|* function converts the fractions to their decimal equivalents (decimal fractions).

9 years ago | 1

| accepted

Answered
I can't plot 2nd order differential equation
*_|I|_* can! Try this: syms x(t); Dx = diff(x); Dx2 = diff(x,2); x(t) = dsolve(Dx2+(5*Dx)+(6*x)==100,x(0)==0,...

9 years ago | 0

| accepted

Answered
How do I solve a single for temperature with one PDE containing dT/dx and dT/dt?
If you need to estimate the other parameter, see <https://www.mathworks.com/help/optim/ug/optimizing-a-simulation-or-ordinary-di...

9 years ago | 0

Answered
About plotting piecewise function.
See if using: for k = 1:length(t) instead, works correctly in your code.

9 years ago | 0

| accepted

Answered
Is there an easy way to format numbers to 3 significant figures?
See the documentation on the <https://www.mathworks.com/help/matlab/ref/sprintf.html *|sprintf|*> (link) function. A = 6....

9 years ago | 1

Answered
Solving a Linear ODE - Help!
Try this: syms A G k h(t) Y Eqn = (2*A*k + 3*G*h(t)^(1/2))*diff(h(t), t) == 2*G*h(t)*(h(t)^(1/2) + (A*k)/G) ...

9 years ago | 0

| accepted

Answered
homework help, my loglog wont plot a line
It won’t because you didn’t tell it to. You told it to plot a point, and since the default behavoiur of *|plot|* is to connect ...

9 years ago | 0

Answered
How to find the largest peak and the 2 negative peaks that are next to it on either side?
I am _guessing_ here, since I do not know what your signal looks like. To find ‘valley floors’ instead of ‘peaks’, _negate_...

9 years ago | 0

Answered
Save workspace varibles to use results
See the documentation on the <https://www.mathworks.com/help/matlab/ref/save.html *|save|*> (link) function, and the related doc...

9 years ago | 0

Answered
The logic behind extracting the values in all corners of a 2-dimensional matrix
*_‘How is the first [1,end] different than the second [1,end]?’_* The first addresses the *_rows_*, the second the *_column...

9 years ago | 1

| accepted

Answered
Finding the max value of a function containing an integral
The problem is that *|‘fun’|* is a function of both *|‘x’|* and *|‘v’|*. You have it only as a funciton of *|‘x’|*. Changing t...

9 years ago | 0

| accepted

Answered
Addition of non-uniform dimensional matrices
*_‘1 - Why Matlab is not giving an error for addition or subtraction of below matrices?’_* Beginning in *|R2016b|*, MATLAB a...

9 years ago | 0

Answered
Graphing using linspace command
I would do something like this: endtc = inputdlg('Maximum time for the simulation '); endt = str2double(endtc{:}); t...

9 years ago | 0

Answered
Why does MATLAB not allow this assignment with the + operator?
This works: planneddose = rand(135, 130, 129); % Create Matrix Out = num2cell(size(planneddose) + ...

9 years ago | 3

Answered
Designing an iterative algorithm for a nonlinear system of equations
The principal problem is that you are calling the function from within the function. I cannot figure out what you are doing...

9 years ago | 0

| accepted

Answered
Trying to take a generated set of values in a matrix and add to it.
Your code runs without error, and while some values of *|‘A’|* are small, none appear to be zero. (Use *|format short E|* rathe...

9 years ago | 0

| accepted

Answered
Store 4 outputs from ten simulations in an 4 arrays.
I have no idea how your simulation works. Assuming it produces one scalar value for each output in each run of the simulation, ...

9 years ago | 1

Answered
Butter filter high pass and low pass
I believe you are seeing the ‘rolloff’ or transition-region characteristics of a Butterworth filter. Note that you did not spec...

9 years ago | 0

| accepted

Answered
How to remove zeros from end of different sizes of rows of matrix?
It will not look like you want it to because _numeric_ arrays must have the same number of columns in each row. The best you ca...

9 years ago | 0

Answered
How to find the overlapping area of two histogram
I would use the *|histfit|* curves, and this example to calculate the area of the overlap: x = linspace(-15, 15); ...

9 years ago | 1

Answered
Generate data points and file from written program
*_‘Use this program to generate data points and file for plotting i(t) versus v(t)’_* The instruction for the plot is clear...

9 years ago | 0

Answered
Why is the lsqnonlin function telling me I don't have enough input arguments?
One problem is that you need to use *|‘@’|* to create a _function handle_ for *|‘myfun’|* in the *|lsqnonlin|* call: [K, r...

9 years ago | 1

| accepted

Load more