Answered

How to plot multiple box plots on same graph with same size vector?

Hi, just change line 1 vol = [D1(:,1);C1(:,1)]; to vol = [D1(:,1), C1(:,1)];

How to plot multiple box plots on same graph with same size vector?

Hi, just change line 1 vol = [D1(:,1);C1(:,1)]; to vol = [D1(:,1), C1(:,1)];

1 year ago | 0

| accepted

Answered

Setting 3D plot's centre at origin

try this set(gca, 'XAxisLocation', 'origin', 'YAxisLocation', 'origin','ZAxisLocation', 'origin')

Setting 3D plot's centre at origin

try this set(gca, 'XAxisLocation', 'origin', 'YAxisLocation', 'origin','ZAxisLocation', 'origin')

1 year ago | 0

Answered

Squeezing NaN's out of a square matrix to make a smaller square matrix

[p,q] = size(M); M(isnan(M))=[]; M = reshape(M,p-1,q) Then M = 2 1 1 1 1 3 3 2 ...

Squeezing NaN's out of a square matrix to make a smaller square matrix

[p,q] = size(M); M(isnan(M))=[]; M = reshape(M,p-1,q) Then M = 2 1 1 1 1 3 3 2 ...

1 year ago | 0

| accepted

Answered

Number of Bacteria.

Here you can use symbolic solution syms N(t) t eq = diff(N)==log(3.32)*N N = dsolve(eq,N(0)==100) N_1dot5_hour = eval(subs(N...

Number of Bacteria.

Here you can use symbolic solution syms N(t) t eq = diff(N)==log(3.32)*N N = dsolve(eq,N(0)==100) N_1dot5_hour = eval(subs(N...

1 year ago | 0

| accepted

Answered

How to store conditional values during iteration by using Ode45?

You can define a table to store the data including the conditional values function main t0=0; tf=15; a0=1; T = table(); gl...

How to store conditional values during iteration by using Ode45?

You can define a table to store the data including the conditional values function main t0=0; tf=15; a0=1; T = table(); gl...

1 year ago | 1

| accepted

Answered

If statement in a for loop

You can do like this A = mat2cell(rand(40,40)+0.5, [10 10 10 10], [10 10 10 10]); % A is your data randomly generated, you ca...

If statement in a for loop

You can do like this A = mat2cell(rand(40,40)+0.5, [10 10 10 10], [10 10 10 10]); % A is your data randomly generated, you ca...

1 year ago | 1

Answered

I want to draw dual phase portraits in a 4x4 linear differential equation system. My codes contain 4 variables as below (x1, x2, y1, y2). For a given coefficients matrix, when

Looks like an ode function, so use matlab ode solver to solve it. Here I give an example of ode 45. A = rand(4,4); tspan = [0...

I want to draw dual phase portraits in a 4x4 linear differential equation system. My codes contain 4 variables as below (x1, x2, y1, y2). For a given coefficients matrix, when

Looks like an ode function, so use matlab ode solver to solve it. Here I give an example of ode 45. A = rand(4,4); tspan = [0...

1 year ago | 0

| accepted

Answered

Create cylinder roll based on height data

You need map the length and the circumference to your true cylinder. cylinder_true_length = 20; cylinder_true_radius = 5; len...

Create cylinder roll based on height data

You need map the length and the circumference to your true cylinder. cylinder_true_length = 20; cylinder_true_radius = 5; len...

1 year ago | 0

| accepted

Answered

reduce samples on a 3d array

Use interp1 my friend, if a is the 160x120x30000 data that you said. [m,n,p] = size(a); a = reshape(a,m*n,p); nSeries = p; ...

reduce samples on a 3d array

Use interp1 my friend, if a is the 160x120x30000 data that you said. [m,n,p] = size(a); a = reshape(a,m*n,p); nSeries = p; ...

1 year ago | 1

| accepted

Answered

How to convert one column of a table into numeric data type corresponding to the other column of the same table?

If you have a table T with field names genre and runtime, then genre = {'ab','a','a','o','abo'}'; runtime = [11,12,13,14,45]';...

How to convert one column of a table into numeric data type corresponding to the other column of the same table?

If you have a table T with field names genre and runtime, then genre = {'ab','a','a','o','abo'}'; runtime = [11,12,13,14,45]';...

1 year ago | 1

| accepted

Answered

splitting cell array consists of string and numeric characters

Use replace S = {...}; % your n*1 cell array S = arrayfun(@(i)replace(S{i},'*',''),1:1:numel(S),'uniform',false);

splitting cell array consists of string and numeric characters

Use replace S = {...}; % your n*1 cell array S = arrayfun(@(i)replace(S{i},'*',''),1:1:numel(S),'uniform',false);

1 year ago | 1

| accepted

Answered

What should I do?-Array indices must be positive integers or logical values.

Hi, g(i,j) may be zero, then m becomes zero. change it like this clc clear close all a=imread('Screenshot_20210628.jpg'); ...

What should I do?-Array indices must be positive integers or logical values.

Hi, g(i,j) may be zero, then m becomes zero. change it like this clc clear close all a=imread('Screenshot_20210628.jpg'); ...

1 year ago | 0

| accepted

Answered

Find an equation of the tangent to the curve at the point corresponding to the given value of the parameter. x=t√,y=t2−2t;t=4

syms t x0(t) y0(t) x y x0 = sqrt(t); % parametric equation for x y0 = t^2-2*t; % parametric equation for y dx = diff(x0); %...

Find an equation of the tangent to the curve at the point corresponding to the given value of the parameter. x=t√,y=t2−2t;t=4

syms t x0(t) y0(t) x y x0 = sqrt(t); % parametric equation for x y0 = t^2-2*t; % parametric equation for y dx = diff(x0); %...

1 year ago | 1

| accepted

Question

What if in matlab answer, your answer is robbed by the questioner and he accepts only his all by himself

I have encountered more than twice now. In the answer community, after you answered a question, the questioner made a minor corr...

1 year ago | 2 answers | 0

Answered

How to Solve for x for 20 functions

You can get symbolic solution by syms K C V B N X eq = K*(B-X)*(N-X)-(C+X)*(V+X); x = solve(eq, X) and the final process is ...

How to Solve for x for 20 functions

You can get symbolic solution by syms K C V B N X eq = K*(B-X)*(N-X)-(C+X)*(V+X); x = solve(eq, X) and the final process is ...

1 year ago | 0

| accepted

Answered

opening multiple excel files in different location with a loop

Try following code % Input number of sites N = input('Number of Location? ', 's'); N = str2double(N) % Loop to read all file...

opening multiple excel files in different location with a loop

Try following code % Input number of sites N = input('Number of Location? ', 's'); N = str2double(N) % Loop to read all file...

1 year ago | 0

| accepted

Answered

How to include current array from multiple for loops into csvwrite filename

Hi, try this command instead csvwrite([num2str(lat),'_',num2str(lon),'.csv'], csvdata)

How to include current array from multiple for loops into csvwrite filename

Hi, try this command instead csvwrite([num2str(lat),'_',num2str(lon),'.csv'], csvdata)

1 year ago | 0

| accepted

Answered

Can I use the movmean function for a time series?

timeseries不支持movmean呢，可以把对其下面的data做操作，比如 ts = timeseries((1:5)',[0 10 20 30 40]); a = movmean(ts.Data,2);

Can I use the movmean function for a time series?

timeseries不支持movmean呢，可以把对其下面的data做操作，比如 ts = timeseries((1:5)',[0 10 20 30 40]); a = movmean(ts.Data,2);

1 year ago | 0

Answered

How do shade different area with specific y interval

Hi, Wan-Yi Chiu I add three more code lines after your code, then it works. clear x = 0:0.01:9; y = sqrt(x); y0 = y(end:-1...

How do shade different area with specific y interval

Hi, Wan-Yi Chiu I add three more code lines after your code, then it works. clear x = 0:0.01:9; y = sqrt(x); y0 = y(end:-1...

1 year ago | 0

| accepted

Answered

Interpolating [X Y Z V] values on cylinder surface

Actually, scatteredInterpolant function is easy to implement what you think. function plot3D(x,y,z,v,m) % scatter3(x,y,z); Tm...

Interpolating [X Y Z V] values on cylinder surface

Actually, scatteredInterpolant function is easy to implement what you think. function plot3D(x,y,z,v,m) % scatter3(x,y,z); Tm...

1 year ago | 0

| accepted

Answered

Matlab online does not save my work.

When you use matlab online to save data, all the data will be instored on this website, please check by clicking matlab driver.

Matlab online does not save my work.

When you use matlab online to save data, all the data will be instored on this website, please check by clicking matlab driver.

1 year ago | 0

Answered

I want to cut/crop an RGB image and paste it on different location in another image

I will show you how to copy Part of image A to a certain position of image B clc;clear A = imread('Lena.jpg'); A = imresize(A...

I want to cut/crop an RGB image and paste it on different location in another image

I will show you how to copy Part of image A to a certain position of image B clc;clear A = imread('Lena.jpg'); A = imresize(A...

1 year ago | 0

Answered

2d Unsteady state heat conduction equation using Gauss-seidel method

Hi, Rajat Powade I have checked your code carefully and I know you have used the 5-point Gauss-Seidel difference method to obta...

2d Unsteady state heat conduction equation using Gauss-seidel method

Hi, Rajat Powade I have checked your code carefully and I know you have used the 5-point Gauss-Seidel difference method to obta...

1 year ago | 0

| accepted

Answered

How to add column (after multiplication) in file imported from excel

Then if you have new column named newColumn previousTable = readtable('...'); newTable = [previousTable, table(newColunm)]; w...

How to add column (after multiplication) in file imported from excel

Then if you have new column named newColumn previousTable = readtable('...'); newTable = [previousTable, table(newColunm)]; w...

1 year ago | 0

| accepted

Answered

How to write following equation with "dsolve" command?

Hi, That means There is no symbolic solution for the differential equation you give.

How to write following equation with "dsolve" command?

Hi, That means There is no symbolic solution for the differential equation you give.

1 year ago | 0

| accepted

Answered

how to swap some vector value?

A general answer is S = 1:100; % count = 1; copyLength = 2; % copyStep = 10; % copyStep>copyLength while count<=numel(S)-co...

how to swap some vector value?

A general answer is S = 1:100; % count = 1; copyLength = 2; % copyStep = 10; % copyStep>copyLength while count<=numel(S)-co...

1 year ago | 0

Answered

Random values in timetable

Do by the following code data = timetable; n=1; for i = 1:5 Time = datetime('now'); Conductivity = rand(1,1); ...

Random values in timetable

Do by the following code data = timetable; n=1; for i = 1:5 Time = datetime('now'); Conductivity = rand(1,1); ...

1 year ago | 1

| accepted

Answered

Matrix 'if' statement

If you do not want the loop, then M = 100; N = 100; [j, i] = meshgrid(1:N,1:M); q = i>j; A(q) = i(q); A(~q)=j(~q);

Matrix 'if' statement

If you do not want the loop, then M = 100; N = 100; [j, i] = meshgrid(1:N,1:M); q = i>j; A(q) = i(q); A(~q)=j(~q);

1 year ago | 1

Answered

How to plot a rectangle from a single point ?

Hi, Use rectangle function rectangle('Position',[0,0,2,4]); % [x_left_down_corner, y_left_down_corner, length, width] Use a...

How to plot a rectangle from a single point ?

Hi, Use rectangle function rectangle('Position',[0,0,2,4]); % [x_left_down_corner, y_left_down_corner, length, width] Use a...

1 year ago | 0

| accepted