Answered

I'm trying to do a Taylor series method for the equation y and compare it to the analytical solution. However, I keep getting a matrix dimension error. any help would be much appreciated.

Using diff reduces the dimension of the array by 1. You check the dimensions of y1, y2, y3, y4..they are of size 1X20, 1X19, 1x1...

I'm trying to do a Taylor series method for the equation y and compare it to the analytical solution. However, I keep getting a matrix dimension error. any help would be much appreciated.

Using diff reduces the dimension of the array by 1. You check the dimensions of y1, y2, y3, y4..they are of size 1X20, 1X19, 1x1...

28 days ago | 0

Answered

How to suplot 3 images (2D data) horizontally?

YOu should follow this: https://in.mathworks.com/matlabcentral/answers/101346-how-do-i-use-multiple-colormaps-in-a-single-fi...

How to suplot 3 images (2D data) horizontally?

YOu should follow this: https://in.mathworks.com/matlabcentral/answers/101346-how-do-i-use-multiple-colormaps-in-a-single-fi...

1 month ago | 0

Answered

plotting array more than one time

a = [0 1 0 0 1 1 1 0 1 0] ; t = 0:1:59 ; t = reshape(t,10,[])' ; a = repmat(a,size(t,1),1) ;

plotting array more than one time

a = [0 1 0 0 1 1 1 0 1 0] ; t = 0:1:59 ; t = reshape(t,10,[])' ; a = repmat(a,size(t,1),1) ;

1 month ago | 0

Answered

Creating a video giving oscillatory motion to a point

A = 0.5 ; f = 1 ; t = linspace(0,10,100) ; x = A*sin(2*pi*f*t) ; h = plot(0.,x(1),'s','MarkerSize',10) ; for i = 1:...

Creating a video giving oscillatory motion to a point

A = 0.5 ; f = 1 ; t = linspace(0,10,100) ; x = A*sin(2*pi*f*t) ; h = plot(0.,x(1),'s','MarkerSize',10) ; for i = 1:...

1 month ago | 0

Answered

How can I export x, y and z matrix to .xyz format file?

Let X, Y, Z be your m, n matrices. x = X(:) ; y = Y(:) ; z - Z(:) ; p = [x y z] ; fid = fopen('test.xyz', 'wt'); fpr...

How can I export x, y and z matrix to .xyz format file?

Let X, Y, Z be your m, n matrices. x = X(:) ; y = Y(:) ; z - Z(:) ; p = [x y z] ; fid = fopen('test.xyz', 'wt'); fpr...

1 month ago | 0

| accepted

Answered

How to plot?

YOu need to proceed like this: m = 300 ; n = 100 ; x = linspace(0,100,m) ; eta0 = 2 ; L = 100 ; W = 100 ; v = 0.14...

How to plot?

YOu need to proceed like this: m = 300 ; n = 100 ; x = linspace(0,100,m) ; eta0 = 2 ; L = 100 ; W = 100 ; v = 0.14...

1 month ago | 0

| accepted

Answered

How to add NaN in cell before last one

a{1} = [1 2 3 4 5 10]; a{2} = [2 2 4 5 10]; a{3} = [8 2 10]; a{4} = [8 2 9 9 2 1 3 10]; v = cellfun('size',a,2); r = nume...

How to add NaN in cell before last one

a{1} = [1 2 3 4 5 10]; a{2} = [2 2 4 5 10]; a{3} = [8 2 10]; a{4} = [8 2 9 9 2 1 3 10]; v = cellfun('size',a,2); r = nume...

1 month ago | 1

| accepted

Answered

How can i make plot with different length vector?

To plot, you are supposed to have dimensions of X and Y equal. Read about interp1. You can do inteprolation and get both the arr...

How can i make plot with different length vector?

To plot, you are supposed to have dimensions of X and Y equal. Read about interp1. You can do inteprolation and get both the arr...

1 month ago | 0

Answered

Solve matrix reshape error

A = rand(6,1200) ; iwant = [sum(A(:,1:600),2) sum(A(:,601:end),2)] ;

Solve matrix reshape error

A = rand(6,1200) ; iwant = [sum(A(:,1:600),2) sum(A(:,601:end),2)] ;

1 month ago | 0

Answered

NEED HELP ON MATRIX MANIPULATIONS

A = [ 21 14 7 0 18 11 4 3 15 8 1 6 12 5 2 9 9 ...

NEED HELP ON MATRIX MANIPULATIONS

A = [ 21 14 7 0 18 11 4 3 15 8 1 6 12 5 2 9 9 ...

1 month ago | 0

| accepted

Answered

How to plot trajectory curve given x and y points as well as minima and maxima of the polynomial?

syms a b c d e ; eqns = [e == 80 ; 207360000*a+1728000*b+1440*c+120*d+e == 0 ; 384160000*a+2744000*b+19600*c...

How to plot trajectory curve given x and y points as well as minima and maxima of the polynomial?

syms a b c d e ; eqns = [e == 80 ; 207360000*a+1728000*b+1440*c+120*d+e == 0 ; 384160000*a+2744000*b+19600*c...

1 month ago | 0

Answered

Intersection of three cylinders

Have a look here: https://in.mathworks.com/matlabcentral/answers/93623-how-do-i-plot-the-line-of-intersection-between-two-surf...

Intersection of three cylinders

Have a look here: https://in.mathworks.com/matlabcentral/answers/93623-how-do-i-plot-the-line-of-intersection-between-two-surf...

1 month ago | 0

| accepted

Answered

how to use dlmwrite for excel sheet has three columns

T = readtable('myexcelfile.xlsx') ; writetable(T,'out.dat') ;

how to use dlmwrite for excel sheet has three columns

T = readtable('myexcelfile.xlsx') ; writetable(T,'out.dat') ;

2 months ago | 0

Answered

How to code this avarage gradient equation in matlab?

Let F be your matrix. [dfdx,dfdy] = gradient(f) ; M = (dfdx.^2+dfdy.^2)/2 ; AG = mean(mean(M)) ; I gave answer quckly....

How to code this avarage gradient equation in matlab?

Let F be your matrix. [dfdx,dfdy] = gradient(f) ; M = (dfdx.^2+dfdy.^2)/2 ; AG = mean(mean(M)) ; I gave answer quckly....

2 months ago | 0

| accepted

Answered

Multiple input values for same function and plot them?

A = [10 20 30 405 50] ; th = linspace(0,2*pi) ; X = zeros(length(A),length(th)) ; for i = 1:length(A) X(i,:) = A(i)*sin(...

Multiple input values for same function and plot them?

A = [10 20 30 405 50] ; th = linspace(0,2*pi) ; X = zeros(length(A),length(th)) ; for i = 1:length(A) X(i,:) = A(i)*sin(...

2 months ago | 0

Answered

Error using patch - Non-numeric data is not supported in 'patch'. While using Plotcube

width = 1 ; length = 1 ; height = 1 ; plotcube([width length height],[ 0 0 0 ],1,[1 0 0]);

Error using patch - Non-numeric data is not supported in 'patch'. While using Plotcube

width = 1 ; length = 1 ; height = 1 ; plotcube([width length height],[ 0 0 0 ],1,[1 0 0]);

2 months ago | 0

Answered

How can I get the angle between centroid of a binary object and a point on it's boundary?

Get the centorid of the image by using mean. So I assume you know all the points A,B,C,D and O. You have (x,y) in hand. If you w...

How can I get the angle between centroid of a binary object and a point on it's boundary?

Get the centorid of the image by using mean. So I assume you know all the points A,B,C,D and O. You have (x,y) in hand. If you w...

2 months ago | 0

Answered

Fitting the data without using curve fitting tool

YOu can use polyfit. p = polyfit(t,z(:,32),3) ; zi = polyval(p,t) ;

Fitting the data without using curve fitting tool

YOu can use polyfit. p = polyfit(t,z(:,32),3) ; zi = polyval(p,t) ;

2 months ago | 0

Answered

Coloring with coordinates.

x_data = [3/8 4 8 16 30 50 100]; uppery = [100 100 100 85 60 30 10]; lowery = [100 95 80 50 25 5 0]; x = [x_data fliplr(...

Coloring with coordinates.

x_data = [3/8 4 8 16 30 50 100]; uppery = [100 100 100 85 60 30 10]; lowery = [100 95 80 50 25 5 0]; x = [x_data fliplr(...

2 months ago | 0

| accepted

Answered

how to solve 'Error using | Matrix dimensions must agree. ' ?

clc; clear all; T=0:0.001:0.07; size(T); cm=1.; lo=-3.545-0.833*log(100*cm)-(9601.-2368.*log(100.*cm))./(T-195.7-32.25*log(1...

how to solve 'Error using | Matrix dimensions must agree. ' ?

clc; clear all; T=0:0.001:0.07; size(T); cm=1.; lo=-3.545-0.833*log(100*cm)-(9601.-2368.*log(100.*cm))./(T-195.7-32.25*log(1...

2 months ago | 0

Answered

Saving geotiff using geotiffwrite

Refer this: https://in.mathworks.com/matlabcentral/answers/355554-problem-creating-a-geotiff-from-a-non-georeferenced-image

Saving geotiff using geotiffwrite

Refer this: https://in.mathworks.com/matlabcentral/answers/355554-problem-creating-a-geotiff-from-a-non-georeferenced-image

2 months ago | 0

Answered

How to compute several results from incremental input values using loops?

x0 = 32 ; dx = 0.2 ; N = 20 ; % iterations needed for i = 1:N x = x0+(i-1)*dx ; end YOu can avoid for loop using: ...

How to compute several results from incremental input values using loops?

x0 = 32 ; dx = 0.2 ; N = 20 ; % iterations needed for i = 1:N x = x0+(i-1)*dx ; end YOu can avoid for loop using: ...

2 months ago | 0

Answered

How to rename a cell into Table

Multiple ways. One way would be, convert the cell tinto table T using cell2table and rename the columns you want by T.Proper...

How to rename a cell into Table

Multiple ways. One way would be, convert the cell tinto table T using cell2table and rename the columns you want by T.Proper...

2 months ago | 0

Answered

How to use imagesc in a time loop?

for time = 1:timeSteps newMatrix = GenerateNewMatrix(matrix,probability); matrix = newMatrix; hAxes = gca; im...

How to use imagesc in a time loop?

for time = 1:timeSteps newMatrix = GenerateNewMatrix(matrix,probability); matrix = newMatrix; hAxes = gca; im...

2 months ago | 0

| accepted

Answered

manipulation attribute between two matrices inside loop

If you are new to MATLAB, read about basics of MATLAB. Read about matrix indexing and loops. MM = rand(40,10) ; MMM = rand(4...

manipulation attribute between two matrices inside loop

If you are new to MATLAB, read about basics of MATLAB. Read about matrix indexing and loops. MM = rand(40,10) ; MMM = rand(4...

2 months ago | 0

Answered

Please help me to understand Error "The expression to the left of the equals sign is not a valid target for an assignment.

A(1:4) = rand(1,5) ; The above will throw error. Becuase A is intialized as 1X4, we are trying to replace it with 1X5.

Please help me to understand Error "The expression to the left of the equals sign is not a valid target for an assignment.

A(1:4) = rand(1,5) ; The above will throw error. Becuase A is intialized as 1X4, we are trying to replace it with 1X5.

2 months ago | 0

Answered

How to add values in the array in matlab?

Read about sum D = rand(11,1) ; thesum = sum(D)

How to add values in the array in matlab?

Read about sum D = rand(11,1) ; thesum = sum(D)

2 months ago | 0

Answered

how to find connected neighbors?

If you know the location of the pixel..uou can use knnsearch or rangeseach. YOu can also search in mathworks, this question has ...

how to find connected neighbors?

If you know the location of the pixel..uou can use knnsearch or rangeseach. YOu can also search in mathworks, this question has ...

2 months ago | 0

| accepted

Answered

how can I plot this function ?

Read about matlab element by element operations: R1=1000 %Ohm% C1=0.000000032;%F% R2=1000 %Ohm% C2=0.000000032;%F% x=lin...

how can I plot this function ?

Read about matlab element by element operations: R1=1000 %Ohm% C1=0.000000032;%F% R2=1000 %Ohm% C2=0.000000032;%F% x=lin...

2 months ago | 0