Answered
hello, i m facing problem to plot all columns of an array in same plot inside for loop.what my code doing is it's executing the value of last column of desired array.the array columns should plot curves for y axis.in code array - 'fxl'
Use hold on after the plot. Or you can save all your data into a amtrix and plot at once. fz1 = 1000; fz2 = 1100; step = 5...

6 years ago | 0

| accepted

Answered
Best way to append regression results
P = cell(3,1) ; for i = 1:3 N = i; % this is the polynomial degree [p,S] = polyfit(x, y, N); P{i} = p ; %%%

6 years ago | 0

| accepted

Answered
Input on making a matrix?
Size of y is 1*N where as size of A is 2N*2N. You need to increase the size of y. You can replace y with: y = linspace(Delta/2,...

6 years ago | 0

| accepted

Answered
Which image is not like the others?
n = numel(I1) ; if nnz(I1==I2==I3) == n dif = I4 ; elseif nnz(I2==I3==I4) == n dif = I1 ; elseif nnz(I3==I4==I1) ...

6 years ago | 0

Answered
Find intersection points between a line and a boundary
Try this one: https://in.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections?focused=5165138&tab=function

6 years ago | 0

Answered
IF else stement with Logical OR operator problem
You should use strcmp(grade,'A') || strcmp(grade,'B') Check the code: grade=input('enter grade of the student:', 's'); ...

6 years ago | 0

| accepted

Answered
plotting lines in 3D
plot3(xyz(:,1),xyz(:,2),xyz(:,3),'b-o')

6 years ago | 0

| accepted

Answered
Implementation of a matrix
syms x [ 4 4]

6 years ago | 0

Answered
Area under a shape?
Read about polyarea, convhull. https://in.mathworks.com/help/matlab/ref/convhull.html convhull gives you coordinates of the p...

6 years ago | 1

| accepted

Answered
Regridding 2D-grid shuffled points from 1-D arrays
You can use ismember. [x_grid, y_grid] = meshgrid(1:10, 20:35); z_grid = sin(x_grid).*cos(y_grid); aux_shuffle = randperm(...

6 years ago | 0

Answered
Alternatives to nanmean?
Let A be your array which have NaN's. % Remove the nan's first A(isnan(A)) = [] ; themean = mean(A) ; Also read about mea...

6 years ago | 1

Answered
Vector sum by index
Using loop: x = [1 4 7 10] ; thesum = zeros(size(x)) ; thesum(1) = x(1) ; for i = 2:length(x) thesum(i) = sum(x(1:i)) ...

6 years ago | 0

Answered
How to create a tiff file from a nx3 matrix
Let data be your n*3 matrix. x = data(:,1) ; y = data(:,2) ; z = data(:,3) ; % convert the data to grid nx = 500 ; ny =...

6 years ago | 0

| accepted

Answered
Finding average radius of a binarized image of a circle
I = imread("image.png") ; I1 = rgb2gray(I) ; I1(I1==1) = 0 ; I1(I1>0) = 1 ; [y,x] = find(I1) ; % Get center of circl...

6 years ago | 0

Answered
How can I multiply N dimensional matrices
C = zeros(3,4,n) ; for i = 1:n C(:,:,i) = A(:,:,i)*B(:,:,i) ; end

6 years ago | 1

| accepted

Answered
How can I write the cell array to an excel
To write an cell array into xlfile, you can use xlsread, writetable. https://in.mathworks.com/help/matlab/ref/writetable.html ...

6 years ago | 0

Answered
Padé approximant for a numerical data array
syms x ; pade(atanh(x))

6 years ago | 0

| accepted

Answered
How to find X value of given Y close to zero ?
[val,idx] = sort(abs(Y)) ; Y(idx) X(idx)

6 years ago | 0

| accepted

Answered
Concatenate arrays calculated by for loop
x = zeros(3,540) ; for i=0:539 A = [T-n, -n.*P, mt(:,1+i).*P]; b = [mt(:,1+i)-n]; x(:,i+1) = inv(A)*b ; end

6 years ago | 0

| accepted

Answered
How can I insert a separate line of text with inputdlg?
This example should help you right.. https://in.mathworks.com/help/matlab/ref/inputdlg.html#mw_7c34942f-1d17-4b93-b859-94926ce2...

6 years ago | 0

Answered
conditional selection on table
You can access the columns of the table using T.columnname or T.(1), T.(2) etc... To get the index where name 'Ali' lies, you c...

6 years ago | 0

Answered
Colour gradient based on 3rd variable for geoshow points
Read about scatter. https://in.mathworks.com/help/matlab/ref/geoscatter.html

6 years ago | 0

| accepted

Answered
how to solve error (Index in position 2 exceeds array bounds (must not exceed 1)).
This array occurs, when you try to extract more number of elements than existitng. Eg. % scalar a = rand ; % a scalar a(1...

6 years ago | 1

| accepted

Answered
Write a Matlab program that rotate ellipse in 3-D about y-axis.
If (x,y) are your ellipse coordinates, use a rotation matrix R, as defined below to rotatate to an angle theta. R = [cos(t) 0 ...

6 years ago | 0

Answered
How can I extract the velocity profiles from quiver plot?
This you can achieve by using interpolation. Read about interp2. You have (X,Y) already. Make your required points at which you ...

6 years ago | 1

| accepted

Answered
Why This Vectorization of my Code Does Not Work?
Might be some problem with indexing. Try this: clc; clear all ; n = 4; % Code 1: c1 = zeros(floor(n/2)+1,n+1); c1(1,1) = ...

6 years ago | 0

Answered
In Matlab: How to create a 2d map from a 3 columns file
data = [1901 0 1 1901 -10 2 1901 -20 3 1902 0 -1 1902 -10 3.5 1902 -20 1.5 1903 0 5 1903 -10 -3 1903 -20 0 ] ; x = da...

6 years ago | 3

| accepted

Answered
Apply the finite difference
Replace dy/dt with (y(t+1)-y(t))/dt Simplify it so that y(t+1) is on LHS and rest all on RHS. You will get a equation, RHS has ...

6 years ago | 2

| accepted

Answered
Difference in Matlab and Excel
Excel fits a striaght line to the data.....to get the same value use polyfit of MATLAB. p = polyfit(X,Y,1) ; p(1)

6 years ago | 0

Load more