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

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

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

Find edges in a plot
A very quck implementation.....canbe further refined and more elegant solution possible. p =[ 106 20; ...

8 days ago | 1

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

How can I convert douvle value to int or Integer?

8 days ago | 0

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

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

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

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

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

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

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

Color map and shading interp not working with plot3

9 days ago | 1

| accepted

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

How to Remove Repeated Row-Vector in a Matrix ?
iwant = unique(A,'rows') ;

9 days ago | 0

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

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

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

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

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

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

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

how to make animation from contour in specified range

10 days ago | 0

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

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 ?

11 days ago | 0

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

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