Answered

How to arrainge data to use streamline?

I guess what you have is unstructured FEM mesh data. YOu need to convert it to grided data. You can do inteprolation using gridd...

How to arrainge data to use streamline?

I guess what you have is unstructured FEM mesh data. YOu need to convert it to grided data. You can do inteprolation using gridd...

8 days ago | 0

Answered

Error using plot Conversion to double from sym is not possible.

YOu have po to be symbolic element. YOu need to substitute x and get the value in double and plot. clc; clear all; syms x ...

Error using plot Conversion to double from sym is not possible.

YOu have po to be symbolic element. YOu need to substitute x and get the value in double and plot. clc; clear all; syms x ...

8 days ago | 0

Answered

Multidimensional for loop to store values/frame

You can reshape the matrix into 2D and use the respective functions. A = rand(2,2,5) ; A = reshape(A,[],5) ; Avg = mean(...

Multidimensional for loop to store values/frame

You can reshape the matrix into 2D and use the respective functions. A = rand(2,2,5) ; A = reshape(A,[],5) ; Avg = mean(...

8 days ago | 0

Answered

Find edges in a plot

A very quck implementation.....canbe further refined and more elegant solution possible. p =[ 106 20; ...

Find edges in a plot

A very quck implementation.....canbe further refined and more elegant solution possible. p =[ 106 20; ...

8 days ago | 1

Answered

how to find division of two consecutive number of matrix without using for loop?

a= [1 2 3 4 5 6 7 8 9]'; iwant = a(1:end-1)./a(2:end)

how to find division of two consecutive number of matrix without using for loop?

a= [1 2 3 4 5 6 7 8 9]'; iwant = a(1:end-1)./a(2:end)

8 days ago | 0

Answered

How can I convert douvle value to int or Integer?

Read about int32, int64, uint32, uint64.

How can I convert douvle value to int or Integer?

Read about int32, int64, uint32, uint64.

8 days ago | 0

Answered

How can I create time in proper format to export to a netCDF (.nc) file in MATLAB?

Convert the dates into numbers using datenum. These numbers can be written into netCDF file. Read about datenum.

How can I create time in proper format to export to a netCDF (.nc) file in MATLAB?

Convert the dates into numbers using datenum. These numbers can be written into netCDF file. Read about datenum.

8 days ago | 0

Answered

How to use a for loop to iterate through all columns in a row, and then go down each row and iterate through all the corresponding columns in the same way?

V = Currents./r ; Where Currents is your 531*758 matrix and r is 531*1 matrix.

How to use a for loop to iterate through all columns in a row, and then go down each row and iterate through all the corresponding columns in the same way?

V = Currents./r ; Where Currents is your 531*758 matrix and r is 531*1 matrix.

8 days ago | 0

Answered

matrix multiply by array xi=xj

e = [0 1 0 1;1 0 1 1;0 1 0 1;1 1 1 0]; x = [1 2 3 4] ; A = zeros(size(e)) ; for i = 1:4 for j = 1:4 A(i,j) = e(i,j)...

matrix multiply by array xi=xj

e = [0 1 0 1;1 0 1 1;0 1 0 1;1 1 1 0]; x = [1 2 3 4] ; A = zeros(size(e)) ; for i = 1:4 for j = 1:4 A(i,j) = e(i,j)...

8 days ago | 0

| accepted

Answered

how to have the same plot area size when some axis names become 2 lines

Use like this: plot(rand(1,100)) title({'First line';'Second line'}) xlabel({'First line';'Second line'}) ylabel({'First l...

how to have the same plot area size when some axis names become 2 lines

Use like this: plot(rand(1,100)) title({'First line';'Second line'}) xlabel({'First line';'Second line'}) ylabel({'First l...

8 days ago | 0

Answered

how to generate 360 images by applying rotation from 1 to 360 degree on same points?

th= 0:1:360 ; R=@(theta) [cosd(theta) -sind(theta) 0; sind(theta) cosd(theta) 0; 0 0 1]; points = ...

how to generate 360 images by applying rotation from 1 to 360 degree on same points?

th= 0:1:360 ; R=@(theta) [cosd(theta) -sind(theta) 0; sind(theta) cosd(theta) 0; 0 0 1]; points = ...

9 days ago | 0

| accepted

Answered

how to solve Beam on elastic foundation equation

You can use symbolic calcultations. Like below: syms E I k w(x) eqn = E*I*diff(w,x,4)+k*w == 0 ; sol = dsolve(eqn) ; You ...

how to solve Beam on elastic foundation equation

You can use symbolic calcultations. Like below: syms E I k w(x) eqn = E*I*diff(w,x,4)+k*w == 0 ; sol = dsolve(eqn) ; You ...

9 days ago | 0

Answered

Why is the contour plot flipped i.e. the value that should be at the bottom right is plotted on the top left?

YOu need not to use loops....it is very slow. Check the below code: Nx = 100 ; Ny = 100 ; x = linspace(0,1,Nx) ; y = lins...

Why is the contour plot flipped i.e. the value that should be at the bottom right is plotted on the top left?

YOu need not to use loops....it is very slow. Check the below code: Nx = 100 ; Ny = 100 ; x = linspace(0,1,Nx) ; y = lins...

9 days ago | 1

| accepted

Answered

Color map and shading interp not working with plot3

surf(x_new,T_disc,all_out); shading interp Shading interp works with pcolor/ surf.

Color map and shading interp not working with plot3

surf(x_new,T_disc,all_out); shading interp Shading interp works with pcolor/ surf.

9 days ago | 1

| accepted

Answered

Is there a way to compute the percentage of pixels in this image of a certain colour, whilst ignoring the (dark blue) background in the calculation?

If I is your image.....And your pixel value is n. Use: idx = I==n ; YOur idx will be a matrix with 1's and 0's...

Is there a way to compute the percentage of pixels in this image of a certain colour, whilst ignoring the (dark blue) background in the calculation?

If I is your image.....And your pixel value is n. Use: idx = I==n ; YOur idx will be a matrix with 1's and 0's...

9 days ago | 0

Answered

deformed surface plot of a plate

You can use this: https://in.mathworks.com/matlabcentral/fileexchange/32719-postprocessing-in-fem If you still unable to get it...

deformed surface plot of a plate

You can use this: https://in.mathworks.com/matlabcentral/fileexchange/32719-postprocessing-in-fem If you still unable to get it...

10 days ago | 1

Answered

Plotting Matrix Columns with Colorbar

How about this approach? x = 0:.05:2*pi; y = sin(x); z = zeros(size(x)); col = x; % This is the color, vary with x in th...

Plotting Matrix Columns with Colorbar

How about this approach? x = 0:.05:2*pi; y = sin(x); z = zeros(size(x)); col = x; % This is the color, vary with x in th...

10 days ago | 0

Answered

I need help with removing a max value from a vector so I can use the next max value

YOu can use max function, this gives you index of the maximum value. You replace that value with NaN or remove it from tha array...

I need help with removing a max value from a vector so I can use the next max value

YOu can use max function, this gives you index of the maximum value. You replace that value with NaN or remove it from tha array...

10 days ago | 0

Answered

finding nonzero elements in matrix

iwant = zeros(size(A)) ; for i = 1:size(A,1) if any(A(i,:)) iwant(i,A(i,:)~=0) = i ; end end

finding nonzero elements in matrix

iwant = zeros(size(A)) ; for i = 1:size(A,1) if any(A(i,:)) iwant(i,A(i,:)~=0) = i ; end end

10 days ago | 0

| accepted

Answered

How to increase matrix size by inserting nan

Let A be your 1*24 array. iwant = NaN(60,24) ; iwant(1,:) = A ; iwant = iwant(:) ;

How to increase matrix size by inserting nan

Let A be your 1*24 array. iwant = NaN(60,24) ; iwant(1,:) = A ; iwant = iwant(:) ;

10 days ago | 0

| accepted

Answered

Create a variable-name of of a string/char

You may try something like this: myvariable = 'Hello_World_I_need_your_help' ; assign( myChar, rand(10) ) Refer here fir...

Create a variable-name of of a string/char

You may try something like this: myvariable = 'Hello_World_I_need_your_help' ; assign( myChar, rand(10) ) Refer here fir...

10 days ago | 0

Answered

calculate the length of scattered data

Let A be your n*2 data points A = [A ; A(1,:)] ; x = A(:,1) ; % x coordinates of the points y = A(:,2) ; % y coordin...

calculate the length of scattered data

Let A be your n*2 data points A = [A ; A(1,:)] ; x = A(:,1) ; % x coordinates of the points y = A(:,2) ; % y coordin...

10 days ago | 0

| accepted

Answered

how to make animation from contour in specified range

Are you looking for this or else? addpath('G://exports/60z1j28v') load('zv_avg.mat') contourlev=[-0.0025:0.0002:0.01]; figu...

how to make animation from contour in specified range

Are you looking for this or else? addpath('G://exports/60z1j28v') load('zv_avg.mat') contourlev=[-0.0025:0.0002:0.01]; figu...

10 days ago | 0

Answered

I have a list of 120 elements in a column, and I need to sum each 12 elements and then sum together the next 12 so from the 120 values I will have 12 different sum values.

YOu need not to use a loop for this...... reshape your column and use sum. c = rand(120,1) ; % your column matrix iwant = s...

I have a list of 120 elements in a column, and I need to sum each 12 elements and then sum together the next 12 so from the 120 values I will have 12 different sum values.

YOu need not to use a loop for this...... reshape your column and use sum. c = rand(120,1) ; % your column matrix iwant = s...

10 days ago | 1

Answered

How to write for loop to import numeric data from columns of excel or csv file and to do dot product with a input vector ?

Read about xlsread to import data from excel to matlab. To calculate the dot product, read about the function dot.

How to write for loop to import numeric data from columns of excel or csv file and to do dot product with a input vector ?

Read about xlsread to import data from excel to matlab. To calculate the dot product, read about the function dot.

11 days ago | 0

Answered

How to get level values by X Y coordinates from a contour plot?

Read the documentation of contour..there is option of getting level values fromt he function. [M,c] = contour(X,Y,Z) ;

How to get level values by X Y coordinates from a contour plot?

Read the documentation of contour..there is option of getting level values fromt he function. [M,c] = contour(X,Y,Z) ;

11 days ago | 0

Answered

What is the mathematical theory of fmincon ?

Check the docmumentation of it..it will be having references; you can refer them for mathematical understanding.

What is the mathematical theory of fmincon ?

Check the docmumentation of it..it will be having references; you can refer them for mathematical understanding.

12 days ago | 0

Answered

How can i plot coordinate point in mutiple color?

x = rand(100,1) ; y = rand(100,1) ; figure hold on plot(x(y<=0.4),y(y<=0.4),'*r') plot(x(y>0.4&y<0.7),y(y>0.4&y<0.7)...

How can i plot coordinate point in mutiple color?

x = rand(100,1) ; y = rand(100,1) ; figure hold on plot(x(y<=0.4),y(y<=0.4),'*r') plot(x(y>0.4&y<0.7),y(y>0.4&y<0.7)...

12 days ago | 0

Answered

how can I find the smallest 3 numbers in a matrix array?

A = rand(1,91) ; [val,idx] = sort(A) ; iwant = val(1:3) locations = idx(1:3)

how can I find the smallest 3 numbers in a matrix array?

A = rand(1,91) ; [val,idx] = sort(A) ; iwant = val(1:3) locations = idx(1:3)

12 days ago | 1