Answered

spatial and temporal mean of ERA5 monthly data

Read about mean. You can specify the dimension you want here.

spatial and temporal mean of ERA5 monthly data

Read about mean. You can specify the dimension you want here.

3 months ago | 0

Answered

How can I make this code more efficient?

Read abput preallocating/ initializing the variables. nx1=1216; nye=160; dx=1.973684; dy=1.875; nm=0; t1 = tic ; % See th...

How can I make this code more efficient?

Read abput preallocating/ initializing the variables. nx1=1216; nye=160; dx=1.973684; dy=1.875; nm=0; t1 = tic ; % See th...

3 months ago | 0

| accepted

Answered

using quiver to create a vector field for an equation with only 1 variable.

alpha = rand ; beta = rand ; p = rand ; q = rand ; y = linspace(0,1) ; yprime = alpha*y - beta*y.^2-(((y.^3)*p)./((y.^3)+q)...

using quiver to create a vector field for an equation with only 1 variable.

alpha = rand ; beta = rand ; p = rand ; q = rand ; y = linspace(0,1) ; yprime = alpha*y - beta*y.^2-(((y.^3)*p)./((y.^3)+q)...

3 months ago | 0

Answered

Sum values on the maximum number of consecutive days

load Sample.mat ; R_3 = R_3' ; n = 1:length(R_3) ; ii = zeros(size(R_3)); jj = R_3 > 1 ; ii(strfind([0,jj(:)'],[0 1])) =...

Sum values on the maximum number of consecutive days

load Sample.mat ; R_3 = R_3' ; n = 1:length(R_3) ; ii = zeros(size(R_3)); jj = R_3 > 1 ; ii(strfind([0,jj(:)'],[0 1])) =...

3 months ago | 0

Answered

How to determine phase shift?

Refer this: https://in.mathworks.com/matlabcentral/answers/91647-how-do-i-calculate-the-amplitude-ratio-and-phase-lag-for-two-si...

How to determine phase shift?

Refer this: https://in.mathworks.com/matlabcentral/answers/91647-how-do-i-calculate-the-amplitude-ratio-and-phase-lag-for-two-si...

3 months ago | 0

Answered

How to plot single colorful line?

x=[1 2 3 4 5 6 ]; y=[1 2 3 4 5 6 ]; z = zeros(size(x)); col = x; % This is the color, vary with x in this case. surface([x;...

How to plot single colorful line?

x=[1 2 3 4 5 6 ]; y=[1 2 3 4 5 6 ]; z = zeros(size(x)); col = x; % This is the color, vary with x in this case. surface([x;...

3 months ago | 1

| accepted

Answered

Iteration through column multiple times

figure hold on for i = 1:16 cplot = squeeze(C(i,:,:)) ; pcolor(xMap+i,yMap,cplot) ; %<--- you need to think of xMap...

Iteration through column multiple times

figure hold on for i = 1:16 cplot = squeeze(C(i,:,:)) ; pcolor(xMap+i,yMap,cplot) ; %<--- you need to think of xMap...

4 months ago | 0

Answered

How to set validation for LSTM Model

options= trainingOptions('adam',... ExecutionEnvironment = 'auto',... MaxEpochs = Epoch,... MiniBatchSize = mini...

How to set validation for LSTM Model

options= trainingOptions('adam',... ExecutionEnvironment = 'auto',... MaxEpochs = Epoch,... MiniBatchSize = mini...

4 months ago | 0

Answered

A line is not appearing when I graph

D=0.05; %m V_Ice=10; %m^3 T_mi=24;%C Ts=0;%C f_vi=0.8;% N=10; %Tubes L=1.55 ;%m m_dot=linspace(0.005,0.05); %kg/s % <--...

A line is not appearing when I graph

D=0.05; %m V_Ice=10; %m^3 T_mi=24;%C Ts=0;%C f_vi=0.8;% N=10; %Tubes L=1.55 ;%m m_dot=linspace(0.005,0.05); %kg/s % <--...

4 months ago | 0

| accepted

Answered

Plot data and keep the maximum values

Read about envelope T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1402969/data.txt') ; x = T.(1...

Plot data and keep the maximum values

Read about envelope T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1402969/data.txt') ; x = T.(1...

4 months ago | 1

| accepted

Answered

A unknown bug on matrix

This is not bug....don't use the sqaure braces. If you are using square braces, than space is considered as a different eleme...

A unknown bug on matrix

This is not bug....don't use the sqaure braces. If you are using square braces, than space is considered as a different eleme...

4 months ago | 0

Answered

I want to read 2 nc files which containing soil moisture as variable, but when readin the given code ,it showing some error

file1= 'path of the file1' ; % path with ame of file file2='path of file2' ; % path with name of file sm1= ncread(file1,'sm'...

I want to read 2 nc files which containing soil moisture as variable, but when readin the given code ,it showing some error

file1= 'path of the file1' ; % path with ame of file file2='path of file2' ; % path with name of file sm1= ncread(file1,'sm'...

4 months ago | 0

Answered

How to do a Taylor expansion with a matrix

syms x f = exp(x) T = taylor(f) In place of x substitue each value of G.

How to do a Taylor expansion with a matrix

syms x f = exp(x) T = taylor(f) In place of x substitue each value of G.

4 months ago | 0

Answered

How to calculate and plot this pcolor plot?

A = rand(1100,800,764) ; mu = mean(A,3) ; sigma = std(A,[],3) ; idx = mu >= sigma/sqrt(764) ; h = pcolor(idx) ; h.EdgeColo...

How to calculate and plot this pcolor plot?

A = rand(1100,800,764) ; mu = mean(A,3) ; sigma = std(A,[],3) ; idx = mu >= sigma/sqrt(764) ; h = pcolor(idx) ; h.EdgeColo...

4 months ago | 1

| accepted

Answered

Can this equation be solved for x? How does the solution look? Thank you

syms x a b c d eqn = x^2-b*x+a^2*x^4-d*x^2+c==0 s = solve(eqn,x)

Can this equation be solved for x? How does the solution look? Thank you

syms x a b c d eqn = x^2-b*x+a^2*x^4-d*x^2+c==0 s = solve(eqn,x)

4 months ago | 0

| accepted

Answered

how to normalize a dataset where the maximum value or the original dataset needs to be the lowest value of the normalized dataset

X=80:1:150 ; R = rescale(X,0.85,0.95) ;

how to normalize a dataset where the maximum value or the original dataset needs to be the lowest value of the normalized dataset

X=80:1:150 ; R = rescale(X,0.85,0.95) ;

4 months ago | 0

Answered

Interpolation of a matrix in 2D for complex numbers

You may use imresize. Let A be your complex matrix: B = imresize(A,2) ; % this makes double the size of A, you can specify t...

Interpolation of a matrix in 2D for complex numbers

You may use imresize. Let A be your complex matrix: B = imresize(A,2) ; % this makes double the size of A, you can specify t...

4 months ago | 0

Answered

Plotting data in 3D

T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1392204/plotdata.xlsx') ; plot3(T.(3),T.(4),T.(5),...

Plotting data in 3D

T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1392204/plotdata.xlsx') ; plot3(T.(3),T.(4),T.(5),...

4 months ago | 0

Answered

I can't find what's wrong with my code

As you are doing a single point at time, you need to use the marker '.'. %input data D_AB=1.5e-07; D=0.1; t=5058.85; n=5...

I can't find what's wrong with my code

As you are doing a single point at time, you need to use the marker '.'. %input data D_AB=1.5e-07; D=0.1; t=5058.85; n=5...

4 months ago | 0

Answered

Trying to do an if/and statement on a vector but have an addition apply to only one element of vector

direction = [350; 8; 355; 1; 359]; direction0 = direction ; direction(direction<10)=direction(direction<10)+360

Trying to do an if/and statement on a vector but have an addition apply to only one element of vector

direction = [350; 8; 355; 1; 359]; direction0 = direction ; direction(direction<10)=direction(direction<10)+360

4 months ago | 0

| accepted

Answered

Unable to perform assignment because the left and right sides have a different number of elements.

Repalce YY(t+1) = y; UU(t+1) = u; with YY(t+1,:) = y; UU(t+1,:) = u;

Unable to perform assignment because the left and right sides have a different number of elements.

Repalce YY(t+1) = y; UU(t+1) = u; with YY(t+1,:) = y; UU(t+1,:) = u;

4 months ago | 0

Answered

Arrays have incompatible sizes for this operation.

sys.B is of size 2x4 and u is of size 3x1....how you can multiply them?

Arrays have incompatible sizes for this operation.

sys.B is of size 2x4 and u is of size 3x1....how you can multiply them?

4 months ago | 0

| accepted

Answered

gradient arrows plot in matlab

a=0.819*10^(-3); b=2.73*10^(-3); Vo=15; rho=linspace(a,b,100); %Updated t t=linspace(0,2*pi,360); [rr,tt]=meshgrid(rho,t);...

gradient arrows plot in matlab

a=0.819*10^(-3); b=2.73*10^(-3); Vo=15; rho=linspace(a,b,100); %Updated t t=linspace(0,2*pi,360); [rr,tt]=meshgrid(rho,t);...

4 months ago | 0

| accepted

Answered

How to extract odd numbered elements.

A = 1:10 ; % Pick only odd elements idx = mod(A,2)~=0 ; A(idx)

How to extract odd numbered elements.

A = 1:10 ; % Pick only odd elements idx = mod(A,2)~=0 ; A(idx)

4 months ago | 0

Answered

How to find every principal submatrix of a matrix. (given input row and column indices)

You can delete 1, 3 rd row and column from 5x5 matrix using: A = rand(5) ; A([1 3],:) = [] ; % delete 1st and 3rd row A(:...

How to find every principal submatrix of a matrix. (given input row and column indices)

You can delete 1, 3 rd row and column from 5x5 matrix using: A = rand(5) ; A([1 3],:) = [] ; % delete 1st and 3rd row A(:...

4 months ago | 0

Answered

I want to draw a mesh surface. But when I use that code to draw it, YZ line is disappeared...

x=[1 2 3]; y=[1 2 3 4]; [X,Y]=meshgrid(x,y); Z=Y; surf(X,Y,Z)

I want to draw a mesh surface. But when I use that code to draw it, YZ line is disappeared...

x=[1 2 3]; y=[1 2 3 4]; [X,Y]=meshgrid(x,y); Z=Y; surf(X,Y,Z)

4 months ago | 0

| accepted

Answered

Index in position 1 exceeds array bounds (must not exceed 1).

T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1388229/radd.csv') ; dB = T.(3) ; % pol_1 = 10*lo...

Index in position 1 exceeds array bounds (must not exceed 1).

T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1388229/radd.csv') ; dB = T.(3) ; % pol_1 = 10*lo...

5 months ago | 0