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/...

4 days ago | 0

| accepted

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...

4 days ago | 0

| accepted

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...

4 days ago | 0

| accepted

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...

4 days ago | 0

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.

4 days ago | 0

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...

4 days ago | 0

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

5 days ago | 0

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 ...

5 days ago | 0

| accepted

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...

5 days ago | 1

| accepted

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...

5 days ago | 0

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...

5 days ago | 1

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...

5 days ago | 0

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,...

5 days ago | 0

| accepted

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...

5 days ago | 0

how to display final partial fraction
I am not certain what result you want. Use the poly (link) function to get polynomials from ‘R’, ‘P’ and ‘K’: nx=[1 -2 -5 6...

5 days ago | 0

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; ...

6 days ago | 1

| accepted

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

6 days ago | 0

| accepted

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...

6 days ago | 0

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...

6 days ago | 0

| accepted

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...

6 days ago | 0

| accepted

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 =...

6 days ago | 0

| accepted

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...

6 days ago | 0

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

6 days ago | 1

| accepted

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); ...

6 days ago | 0

| accepted

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...

6 days ago | 0

How do I restore MATLAB to original settings?
If you have R2018a or later, you might be able to do that using the information in the documentation section on Access and Modif...

7 days ago | 0

'Bandpass Butter filter' bode plot seems to not take into account the lower cutoff frequency
The bode function needs to know that you are plotting a discrete filter, because the filter coefficients are different than for ...

7 days ago | 0

| accepted

VAN DER PAUW equation
Convert your equation to an anonymous funciton, then use the fzero function: vdp = @(R) exp(-pi*100./R)+exp(-pi*79./R)-1; R...

7 days ago | 1

How can I make the range for the code below from 1 to 1000 to 0.1 to 5 ?!
First, you do not need the loop, since randi can produce everything you need in one call: Initial_POP = randi(1000, 50, 2); S...

7 days ago | 0

| accepted