make different numbers with the same digits
str = '215' ; num = str2num(perms(str)) ; greater = num(num>str2num(str)) lesser = num(num<str2num(str))

2 jours ago | 0

code to detection the cars this code not counting cars properly How do i make it count correct ?
It looks like the dimensions of image A, B are not same. So while subtracting you are getting the error. You need to resize th...

3 jours ago | 0

| accepted

how to find a root of polynomial using matlab
sym c(y) c(y)= 1+3*tan(y/sqrt(2))==0 ; r = solve(c,y) ; double(r)

3 jours ago | 0

How to plot the Best Fit circle throught the points?
Try this: https://in.mathworks.com/matlabcentral/fileexchange/5557-circle-fit

3 jours ago | 0

Help in Plotting X, Y and Heading Angle
Let V be your 64*15 data matrix. X = V(:,1:5) ; Y = V(:,6:10) ; Z = V(:,11:15) ; % If you want a surface and the data co...

3 jours ago | 0

How to find the gradient of the best fit line?
Gradient is slope...you already have it in your hand.. p = polyfit(x,y,1) ; m = p(1) % slope of line

3 jours ago | 0

How can plot precipitation data with latitude longitude information? I have matrix of precipitation over the time,latitude and longitude all are in 470*160*140 dimensions.
Let lon, lat, P be your matrices of size 470*160*140. [m,n,p] = size(P) ; for i = 1:p pcolor(lon(:,:,i),lat(:,:,i),P(:...

3 jours ago | 1

| accepted

Creating a profile of 2D array
I hope you have X, Y, Z matrices of size specified. And you want to know the value at given point (x,y). IN that case you need t...

4 jours ago | 0

Making consecutive 1s and 0s as a seperate element

4 jours ago | 0

How to find x-values when y-function equals a set value?
You can take your curve as L1 and define your straight line at y = 0.7 as curve L1 and use InterX. Get the function InterX from:...

5 jours ago | 0

creat matrix with specific row element
iwant = zeros(100) ; iwant(:,1:2:end) = 2 ;

5 jours ago | 0

Exporting a code from Maple to Matlab
Some thing like this: x = linspace(0,1) ; t = linspace(0,1) ; [x,t] = meshgrid(x,t) ; u =1./(1. + exp(x)).^2 + 1./(1. + e...

5 jours ago | 0

Storing a surface slice in a .mat file and plotting the stored slice
You save all the slices into a cell and save them into .mat file. S = cell(N,1) ; S{1} = slice(X,Y,Z,vol,X_1,Y_1,Z_1,'linear...

5 jours ago | 0

Contour plot size reduction
Use this: https://in.mathworks.com/matlabcentral/fileexchange/23629-export_fig for exporting images for better quiality.

5 jours ago | 0

Converting Frequency domain to time domain
data = csvread(myfile.csv) ; % also have a look on readtable, xlsread a = data(:,1) ; % acceleration f = data(:,2) ; % fr...

5 jours ago | 0

How can I fix "Index exceeds the number of array elements (1)."
Modify it to: function [ca, depth] = transientDiffModel(B,Ds,H,ct,dz,t,th) B= input(' B:degradation rate of antibiotic in biof...

5 jours ago | 1

Filling in 8x8 matrix with formula
A = zeros(8,8) for i = 1:8 p = (pi/16)+(i-1)*(pi/8) for j = 1:8 A(i,j) = cos((j-1)*p) end end ...

6 jours ago | 1

| accepted

How to split data into multiple "chunks"?
Read about reshape. A = rand(1,1000) ; n = 100 ; iwant = reshape(A,100,[]) ; size(iwant) iwant(:,1) % 10 columns of 10...

6 jours ago | 0

trying to output mean values that were calculated into excel.
May be you want to find the mean for every four elements and get 10 means. See the below: A = rand(1,40) ; % random data for ...

6 jours ago | 0

avoiding nested for loops for matrix assignment
m = 10000 ; n = 10000 ; [i,j] = meshgrid(1:n,1:m) ; a = i+j ;

6 jours ago | 0

| accepted

Obtaining the valuse within the bouandary from my map
Something like this: [m,n,p] = size(EWT) ; [X,Y] = meshgrid(lambda-180,phi) ; B_1 = shaperead('Aqueduct_river_basins_TIGRIS...

6 jours ago | 0

Set variable = 0 and run while loop
We can help you in specific if you show us the code. As of now, you can save the variables inside the loop into an array and p...

6 jours ago | 0

Nested If Statement HELP
prompt = ' enter a value between 0 and 100 ' ; x = input(prompt) ; if x >= 90 && x <= 100 disp (' Grade is A '); else...

6 jours ago | 0

Display the Vertex and Triangle labels on a meshes plot
x = rand (10,1); y = rand (10,1); tri = delaunay (x, y); triplot (tri, x, y); hold on; plot (x, y, "r*"); nodes = [1...

6 jours ago | 1

| accepted

How can I fix "error Using plot" "Data cannot have more than two dimensions"?
Your V2 is a 3D array..it is of size 1*1*91.....Use: plot(Hp,squeeze(v2),'-b') Check your code where V2 is generated and try t...

6 jours ago | 0

Index exceeds the number of array elements (1)
Your file nums2.txt has alternate lines of data..every alterate line is a empty line, when you try to read using the file using ...

6 jours ago | 0

| accepted

how to plot quadratic equation with 2 variable
x = linspace(0,1) ; y = linspace(0,1) ; [X,Y] = meshgrid(x,y) ; f = 1/2*X.^2 + X.*Y + Y.^2 + Y ; surf(X,Y,f)

7 jours ago | 0

Unequal vectors in one matrix.
C1=[1 1 1 1 2 2 2 2 1 1]; C2=[0 0 0 0 3 3 3 3 ]; C3=[4 4 4 4 5 5 5 5 6 75 5]; C4=[6 5 6 6 7 7 7 7]; iwant = NaN(4,11) ; i...

7 jours ago | 0

Newton Raphson method help
fun = @(x) x^3 + 2*x^2 - 2; dfun = @(x) 3*x^2 + 4*x ; function [x1,n] = newton(fun,dfun,x0,tol) n = 0; x0 = rand ; % in...

7 jours ago | 1