Answered
Error while using syms in matlab
Try the solution in: <https://www.mathworks.com/matlabcentral/answers/399991-syms-sym-and-mupad-functions-cause-matlab-to-freeze...

8 years ago | 0

| accepted

Answered
how to write solve this problem in matlab?
This works: str = 'today is sunday'; words = regexp(str, ' ', 'split'); minlen = min(cellfun(@numel, words)); fo...

8 years ago | 0

Answered
function needs to return multiple outputs but only returns one, leads to incorrect plot
If your function returns more than one output, you have to ask for as many of them as you need in your calling code. *_Exam...

8 years ago | 0

Answered
Plotting error bars / Standdarddeviations
You did not say exactly what you had tried. See if this does what you want: figure errorbar(x, y, err) grid ...

8 years ago | 0

| accepted

Answered
How to create multiple data structures
If you also want to use your *|‘a’|*, *|‘b’|*, *|‘c’|*, *|‘d’|* field names in your structure, this works: A = {'a';'a';'a...

8 years ago | 0

Answered
Why did I get this error? Array indices must be positive integers or logical values. I copied and pasted MATLAB sample code
Check to see what *|‘gaze_data’|* is in your workspace: S = whos('gaze_data')

8 years ago | 0

Answered
How to plot a mesh with colors like contour?
See if the <https://www.mathworks.com/help/matlab/ref/trisurf.html *|trisurf|*> (link) function does what you want.

8 years ago | 0

Answered
How to integrate the given integration?
To do symbolic integration, use the Symbolic Math Toolbox <https://www.mathworks.com/help/symbolic/int.html *|int|*> (link) func...

8 years ago | 0

Answered
How to make linear fit?
Try this: I = openfig('test.fig'); Ax = gca; L1 = findobj(Ax, 'Type','line'); % F...

8 years ago | 0

Answered
How can inter burst intervals (IBIs) be extracted from the EEG signal?
*Figure |1|* appears to use the Signal Processing Toolbox <https://www.mathworks.com/help/signal/ref/envelope.html *|envelope|*>...

8 years ago | 0

Answered
Split information from the same cell into diferent cells
Try this: houses = {'House_red'; 'House_blue'; 'House_green'}; s = regexp(houses, '_', 'split'); H = cellfun(@(x)x(:...

8 years ago | 1

| accepted

Answered
Finding an element = 0 in an array
You may be encountering ‘floating-point approximation error’, explained in: <http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-...

8 years ago | 1

Answered
Solving a System of ODEs
Try this: ... %Initial Conditions condx1 = x(0) == 1; condy1 = y(0) == 1; condz1 = z(0) == 0; %Soluti...

8 years ago | 1

| accepted

Answered
please help me plotting the curve. Its working fine till second last line but not plotting the curve.
You have not defined *|‘A’|*, so it is not possible to evaluate *|‘P’|* in order to plot it. Changing your code slightly: ...

8 years ago | 0

| accepted

Answered
Looping ode45 Increasing Parameter
You did not post your constants, so I cannot run your code. Most likely, you need to subscript *|‘mp’|* in your *|‘odefun’|...

8 years ago | 1

Answered
how to plot a color-coded matrix
Try this: a=[1 0 3;1 1 4;1 2 4;1 3 5] x=a(:,1); y=a(:,2); z=a(:,3); L1 = (z > 1) & (z <= 3); ...

8 years ago | 0

| accepted

Answered
Problem on code while plotting a graph
The actual error is most likely in the line just above your *|title|* call. Check it to be certain it is entered correctly....

8 years ago | 0

| accepted

Answered
fprintf and arrays of varying length
The *|fprintf|* (and *|sprintf|*) functions will do that by default: A = [1 1 1 1 1]; fprintf('%2d', A) fprintf('\n'...

8 years ago | 4

| accepted

Answered
How to plot multivariable functions against each other?
Vectorize all the vector multiplications and divisions, and it works: GF = (kagf * (kdap1 * x - vs2ap1 * (y / (kafak + y))...

8 years ago | 0

| accepted

Answered
Matlab Error (Z must be a matrix, not a scalar or vector.)?
When you call *|meshgrid|* with *|3|* vectors, it returns *|3D|* matrices for all the outputs. The error message is slightly mi...

8 years ago | 0

Answered
ode45 + lsqcurvefit- multiple ODEs
Similar to <https://www.mathworks.com/matlabcentral/answers/43439-monod-kinetics-and-curve-fitting *Monod kinetics and curve fit...

8 years ago | 0

| accepted

Answered
Use logical values to extract a matrix not a vector?
This will work for *_this particular problem_* and perhaps for similar situations. It will not work generically: A = M.*l...

8 years ago | 0

Answered
Plotting datapoint as you calculate them
Try these: figure(1) x=-1; while(x<1) y=sqrt(1-(x^2)); plot(x,y,'p') axis([0 2 0 1.5]) ...

8 years ago | 0

| accepted

Answered
Fit curve to nonstandard data
I am not certain what you want to do. The problem is that you have several sets of data in each vector, so taking the unique *|...

8 years ago | 0

Answered
How can I filter this figure ?
If you have *|R2018a|*, use the <https://www.mathworks.com/help/signal/ref/bandpass.html *|bandpass|*> (link) function to design...

8 years ago | 0

| accepted

Answered
Transform into a Matlab datetime format, Part 2 (Sample File Attached)
Try this: TestTbl = readtable('Test.csv'); DT = datetime(TestTbl{:,1}, 'InputFormat','MM/dd/yyyy', 'Format','MM/dd/...

8 years ago | 0

| accepted

Answered
Mupad will not start
See: <https://www.mathworks.com/matlabcentral/answers/399991-syms-sym-and-mupad-functions-cause-matlab-to-freeze *"syms", "sym",...

8 years ago | 0

| accepted

Answered
Surface plot using multiple excel files
I just now read your email to me. (Normally, I do not reply to them.) You probably do not need the loop. The *|fft|* func...

8 years ago | 0

Answered
Find the mean of values in a column when a condition is met
Try this: M = randi(9, 10, 3) % Create Matrix someValue = 3 ...

8 years ago | 1

| accepted

Answered
Why is it that their is error in plotting a 2D plot?
You have a script called *|‘plot.m’|*, apparently in your user directory. Rename your *|‘plot.m’|* script something different, ...

8 years ago | 0

Load more