Answered
subtracting a number from string
One approach: str = 'subject1_EO'; nrc = regexp(str, '\d+', 'match') nr = str2double(nrc{:}) producing: nrc = 1×1 cell...

7 years ago | 1

Answered
non linear equation, fminsearch, to find unknown parameters
I am not certain what you are doing. I altered your code slightly: xc = @(k,n,a) (k.^n.*((1515-T)./CR).^n+a)./(1+k.^n.*((15...

7 years ago | 0

Answered
Storing data for "for loop"
Try something like this: L0 = [1 2 3 4 5]; L10 = [2 3 4 5 6]; L20 = [0 9 2 3 4]; L = [L0; L10; L20]; x = 0:4; n = size(...

7 years ago | 1

| accepted

Answered
how to plot symbolic equation
That requires a bit of name-value pair arguments to the fcontour function. Try this: syms f(x,y) x y f(x,y) = x^2 + (3*y...

7 years ago | 0

| accepted

Answered
Cant run this script, trying to plot a graph, please help
My pleasure. When I did: D1 = load('PC3_DMSO_0.5uM_4c.mat') I got: D1 = struct with fields: PC3_TOFA_5uM_8:...

7 years ago | 0

Answered
Simplifiy function incorrect result?
You just need to tell simplify to keep simplifying: DetJa = simplify(detJa, 'Steps',500) producing: DetJa = l3*l4*sin(q3)...

7 years ago | 0

| accepted

Answered
For with a 0.1 step
Indices must be integers greater than 0, or logicals. Try this: i=1:0.1:10; for k = 1:numel(i) theta=0; betha=1/...

7 years ago | 0

| accepted

Answered
Tangents to the curves
At what point do you want to plot the tangent? The usual approach is to use the gradient function to find the slope, then use...

7 years ago | 0

| accepted

Answered
How to connect the multi scatter?
I am not certain what reault you want. Try this: p=1:10; pone=randi(10,1,numel(p)); ptwo=randi(10,1,numel(p)); plot(p,po...

7 years ago | 0

| accepted

Answered
Jarque-Bera test!
Guessing here, since we don’t know what ‘x’ is. It appears that ‘x’ may be complex. If so, your best approach is likely to u...

7 years ago | 0

Answered
Undefined operator '-' for input arguments of type 'table'.
One option is to use the table2array (link) function to extract your table data to an array kstest can use.

7 years ago | 0

Answered
polyfit equation in scatter in matlab
Try this: text(min(xlim)+0.1*max(xlim), max(ylim)-0.1*max(ylim), sprintf('y = %.3f*x + %.3f', p)) % Top Left Corner Exper...

7 years ago | 0

Answered
Matlab as LaTeX interpreter?
To a limited extent at least, yes. See the text (link) documentation section on Interpreter (link).

7 years ago | 0

Answered
How to fix error using fread
Be sure you are using 'ubit1' and not 'ubitl'. It is not at all uncommon for people to use the lower-case ‘l’ instead of the ...

7 years ago | 0

| accepted

Answered
How to find a double integral
It is best to vectorize your function using element-wise operations, then create it as a function of the two variables, then use...

7 years ago | 1

| accepted

Answered
Creating a piecewise sine function having different frequency components
Try this: Fs = 1000; t = linspace(0, 1, 1E+3)/Fs; % Time Vector (1 sec) f = 100:100:3...

7 years ago | 0

Answered
interp2 changes the value of pixels also
‘In my image the value of pixels are only 0, 1 , 2 , 3 but when I read the image I get after interp2 some values such as 2.67 ap...

7 years ago | 1

Answered
solving nonlinear equation by fsolve
You need to return ‘SI_sol’ from ‘singhandyu’, so declare it as: function [SI_sol] =singhandyu(P,Q,P5,lambda,Ts,fc) Also, 0 i...

7 years ago | 0

Answered
Substitute multiple values to array of expressions
The ‘x’ values are not ‘x1’, ‘x2’, ..., but ‘x(1)’, ‘x(2)’, ... Try this instead: q = subs(xs(1),{x(1),x(2),x(3),x(4)},{[0,...

7 years ago | 0

| accepted

Answered
Ode45 problem with equations
If your ‘f1’ function executes, then at least it is working. I get the impression that it is ‘stiff’, particularly because of...

7 years ago | 0

Answered
I want to know how to plot the intersection of a 3D picture with a plane.
I am not certain what you want. Try these: x=-10:0.1:10; y=x; [x,y]=meshgrid(x,y); z=1-5*x.^2+3*y.^2+7*x.*y+4*x-9*y; ...

7 years ago | 1

| accepted

Answered
setting tolerance in lsqcurvefit
Bad fits with the nonlinear parameter estimation routines are most likely the result of either the model not correctly describin...

7 years ago | 0

| accepted

Answered
Mean of Matrix Rows
The row means would be calculated as the mean of dimension 2. Try this: A = rand(5); Anew = A - mean(A,2); Check = mean(A...

7 years ago | 1

| accepted

Answered
difference between commands of CTFT and DTFT
If I understand your Question correctly, the Symbolic Math Toolbox fourier function computes the analytic Fourier transform of a...

7 years ago | 0

| accepted

Answered
How do I change the parameters and then evaluate the function again
First, you do not need the ’Pfunction’ function, since it simply returns ‘f’ as a function. Just use ’f’ directly. After tha...

7 years ago | 0

| accepted

Answered
Patch Multiple Specified Colors
The simplest way is probably to define a colormap for the figure. Try this: X = [0 0; 0 0; 4 4]; Y = [0 4; 3 7; 0 4]; C =...

7 years ago | 1

| accepted

Answered
multiplying cell array with a matrix
You may want to do element-wise (array) multiplication rather than matrix multiplication. Try this: @(x)x.*matrix Note the...

7 years ago | 0

Answered
Matlab documentation in printed format
Downloading and printing the PDF Documentation (link) is likely the best you can hope for.

7 years ago | 1

| accepted

Answered
plot3 error bars
The errorbar function is only defined for 2D plots. Here’s one approach to plotting errorbars with plot3: x = rand(10,1); ...

7 years ago | 2

| accepted

Answered
what is the solution of this error?
This assignment: t(1,:) = 20; creates a (1x1) value for ‘t’, so in this assignment: t(j+1) = 60*t(j,2)-59*t(j,1)+300; ‘t(j...

7 years ago | 0

Load more