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

7 years 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...

7 years 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...

7 years 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...

7 years 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

7 years 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(:) ;

7 years 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...

7 years 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...

7 years 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...

7 years 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...

7 years 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.

7 years 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) ;

7 years 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.

7 years 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)...

7 years 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)

7 years ago | 1

Answered
How To Combine Cropped Image to the Original Image?
I = imread('cameraman.tif') ; % read image [I1,rect] = imcrop(I) ; % crop the image nx = round(rect(1)) ; % location...

7 years ago | 0

| accepted

Answered
How to save calculated values in same column but in different row?
You should save something like this: N = 10 ; A = zeros(N,1) ; % initialize the array to store required values % loop f...

7 years ago | 0

| accepted

Answered
Heatmap on 1d-time series data
YOu can use somehting linke this: x = 0:.05:2*pi; y = sin(x); z = zeros(size(x)); col = x; % This is the color, vary with...

7 years ago | 0

| accepted

Answered
I have a matrix A = [1 1 0 0 1 1]
A = [1 1 0 0 1 1] ; m = length(A) ; B = zeros(m+1) ; insert = @(a, x, n)cat(2, x(1:n), a, x(n+1:end)); for i = 1:m+...

7 years ago | 0

Answered
optimizing for loop that is been called often
Oper_year=1:1:Lifetime; [costM,PVcost,YearProd,Elcost]=deal(zeros(size(Oper_year))); costM(1)=Mcost*PVprice*PVP; PVcost(1)=...

7 years ago | 0

| accepted

Answered
How can I translate a line() in the direction perpendicular to it? (Like a scan)
You can translate a line or given points by simply adding the value (a number) by what distance you want to translate. If you wa...

7 years ago | 0

Answered
Cropping a face from an Image
I = imread('cameraman.tif'); [J, rect] = imcrop(I); Perform the crop operation by double-clicking in the crop rectangle or sel...

7 years ago | 1

| accepted

Answered
Change random values in the matrix of 234*10000
You should follow like this: X= rand(10) shi=randperm(numel(X),3); %For 10000 simulations and limiting the jump to go only upt...

7 years ago | 0

| accepted

Answered
Hot to store results from for loop in matrix
You need not to run a loop to get the difference..simply use the fucntion diff. A = rand(22,9) ; A = [zeros(22,1) A] ; i...

7 years ago | 0

| accepted

Answered
data fitting that output eigenvalues and eigenvectors of the data
You can do regression, check the function https://in.mathworks.com/help/deeplearning/ref/regression.html. Note that eigenvalues...

7 years ago | 0

Answered
Finding maximum value between specific columns for each row
iwant = max(A(:,[2 3]),[],2)

7 years ago | 2

| accepted

Answered
How to plot a comparison of two values to a main value
Read about scatter.

7 years ago | 0

| accepted

Answered
How would I write this code without using loops?
i = 1:1000 ; O = zeros(size(i)) ; idx1 = rem(i,5)==O | rem(i,7)==O ; idx2 = rem(i,5)==O & rem(i,7)==O ; iwant = find(...

7 years ago | 0

Answered
area calculation of black part
A crude/ rough estimate I = imread('binary2.jpg') ; [y,x] = find(I<=180) ; iwant = nnz(x) ; imshow(I) hold on plot(x...

7 years ago | 0

Answered
How to find the value of a function for different input?
Multiple methods: Method # 1 Anonymous functions f = @(x) x.^2+3*x ; x = linspace(1,20,100) ; y = f(x) ; plot(x,y) ...

7 years ago | 0

Load more