Answered
Plot direction and magnitude from north and south components
Read about quiver.

6 years ago | 0

Answered
Magnitude and direction from north and east components
If (x,y) is a componenet m = sqrt(x^2+y^2) ; % magnitude theta = atan(y/x) ; % direction

6 years ago | 0

Answered
Printing table using fprintf
Why you want to use fprintf for table? Read about writetable.

6 years ago | 0

Answered
how to write a code to get these figures ??
Read about plot, subplot, sin th = linspace(0,2*pi) ; x1 = sin(th) ; x2 = cos(th) ; figure(1) plot(th,x1) figure(2) ...

6 years ago | 0

Answered
identify a boundary in an image (matrix form)
Let X,Y,Z be your matrices. idx = ~isnan(Z) ; x = X(:) ; y = Y(:) ; idx = boundary(x,y) ; plot(x(idx),y(idx))

6 years ago | 0

Answered
How to quickly index the first cell of sets of the array with near similar names?
YOu can get the variable names into a cell and use strcmp to check the variable. S = whos ; v = {S.name} ; idx = strfind...

6 years ago | 0

Answered
Contour plot with filled colors (for x, y, z data)
x = A(:,1) ; y = A(:,2) ; z = A(:,3) ; %%structured xi = unique(x) ; yi = unique(y) ; [X,Y] = meshgrid(xi,yi) ; Z = reshape...

6 years ago | 1

Answered
How to add a single number to a 1*2401 matrix?
If A is array and k is constant. iwant = A+k;

6 years ago | 0

| accepted

Answered
2D colored plot
z = randi(10,1,8760); x=1:7 y=1:24 [X,Y] = meshgrid(x,y) ; Z = z(X.*Y) ; pcolor(X,Y,Z) shading interp colorbar

6 years ago | 1

| accepted

Answered
Find max and min values, seperated by max or min
Let A be your array. [val1,idx1] = max(A) ; A(idx1) = NaN ; [val2,idx2] = max(A) ; if idx1 > idx2 [val3,idx3] = min(...

6 years ago | 0

| accepted

Answered
Skipping certain values while using a loop
Let Y be your year data. [c,ia,ib] = unique(Y) ; N = length(c) ; iwant = zeros(N,1) ; for i = 1:N iwant(i) = mean(hei...

6 years ago | 0

| accepted

Answered
Combine two vectors together
iwant = sort([a, b])

6 years ago | 1

Answered
Writing row vectors to file
M = [Vec_A; Vec_B] ; fid = fopen('MyFile.txt' , 'wt') fprintf(fid, [repmat('%f\t', 1, size(M,2)) '\n'], M') ...

6 years ago | 0

Answered
How to read single sheet from multiple sheets of excel file?
num = xlsread(filename,sheet) In the place of sheet, you specify the sheet number. Also read about readtable.

6 years ago | 0

| accepted

Answered
How do you find the 10 entry in this program
MATLAB stores arrays in column-wise. You can get 10th element using iwant = myMatrix(10) ;

6 years ago | 1

Answered
repeating a for loop
n = 4 ; for i=1:1:n Res(i)=input ('Enter the resistance values in ohm,R1 to Rn,values must be positive and real > '); wh...

6 years ago | 0

| accepted

Answered
How to find the difference between two column in two netcdf files
You have to read netCDf files. Read about ncdisp, ncread. Load the data of two files into two variables. Get the difference ...

6 years ago | 0

Answered
Solve a matrix containing unknowns
syms c x y eqn{1} = 2*x+c*y == 8 ; eqn{2} = 2*y == -4 ; eqn{3} = x+y == 1 ; s = solve(eqn{1},eqn{2},eqn{3},x,y,c) s.c ...

6 years ago | 0

| accepted

Answered
How to have multiple comet functions all in one graph?
th = linspace(0,2*pi,10^3) ; x0 = cos(th) ; y0 = sin(th) ; x = th ; y = [x0 ; y0] ; for i = 1:length(th) plot(x(1...

6 years ago | 0

Answered
store the reshaped matrix from the nested cell array
matrix A 10*10 can be converted to array 1*100 using A(:)

6 years ago | 1

Answered
How to change the color of a graph line when using comet function?
[m,n] = size(Location) ; % hoping Location to be m*2 array for i = 1:m plot(Location(1:i,1),Location(1:i,2),'color','r')...

6 years ago | 0

Answered
How to define XY coordinates are on left and right side
Follow the below steps. Pick a point (x,y) from the set of points. Using knnsearch get N number of points close to the (x,y) ...

6 years ago | 0

Answered
How to convert pixel coordinate system to image coordinate system
Let I be your image. [m,n,p] = size(I) ; r = 1:n ; c = 1:m ; [X,Y] = meshgrid(r,c) ;

6 years ago | 0

Answered
How to calculate area under curve.
Read about polyarea

6 years ago | 0

Answered
How to plot data with classes
Read about gscatter https://in.mathworks.com/help/stats/gscatter.html.

6 years ago | 0

| accepted

Answered
Trying to Solve for a Matrix with sinusoidal inputs
Are you looking for something like this? %Admittance for Walls clear %Mti=Mrsi*Mc*Mi*Mrse*Mte %Values for Matrices %Mrsi...

6 years ago | 0

Answered
word count of a document image
If you have a string...you can use striaght away length to get its size. If you have a paragraph: https://in.mathworks.com/mat...

6 years ago | 0

| accepted

Answered
how to read 1000 csv files and write the 1000 csv files as a 3D matrix
csvFiles = dir('*.csv') ; N = length(cSVFiles) ; % intialize required arrays time = zeros([],[],N) ; v = zeros([],[],N) ...

6 years ago | 0

Answered
How to create a mesh surface from given 3D coordinates?
Two options: %%structured xi = unique(x) ; yi = unique(y) ; [X,Y] = meshgrid(xi,yi) ; Z = reshape(z,size(X)) ; figure su...

6 years ago | 0

| accepted

Answered
Find a submatrix in a matrix
https://in.mathworks.com/matlabcentral/answers/395258-most-efficent-way-of-finding-submatrices-of-a-matrix https://in.mathwor...

6 years ago | 0

| accepted

Load more