Answered

Error using sym/subsindex

Initialize the cell first. Q =cell(length(a),length(ttt)) ; % initialize USe this in the loop. Q{i,j} = %% your formul...

Error using sym/subsindex

Initialize the cell first. Q =cell(length(a),length(ttt)) ; % initialize USe this in the loop. Q{i,j} = %% your formul...

6 days ago | 0

Answered

How to cut area or some part of image ?

How about using this? https://www.mathworks.com/help/images/ref/imfreehand.html

How to cut area or some part of image ?

How about using this? https://www.mathworks.com/help/images/ref/imfreehand.html

6 days ago | 0

Answered

How to avoid patch color being included in legend ?

clc; clear all; close all; x = linspace(-10,10,200); y = sin(4*x); y1 = sin(x); figure; hold on patch([2 5 5 2], [[1 1]...

How to avoid patch color being included in legend ?

clc; clear all; close all; x = linspace(-10,10,200); y = sin(4*x); y1 = sin(x); figure; hold on patch([2 5 5 2], [[1 1]...

6 days ago | 1

Answered

Change resolution of .xyz file in matlab

You need to interpolate your data. Read about interp2. Also if you have Z data, you can use imresize. Read about this as well....

Change resolution of .xyz file in matlab

You need to interpolate your data. Read about interp2. Also if you have Z data, you can use imresize. Read about this as well....

6 days ago | 0

Answered

Create stl. file with [F,V,N] data

USe this: https://www.mathworks.com/help/matlab/ref/stlwrite.html#d120e1182467

Create stl. file with [F,V,N] data

USe this: https://www.mathworks.com/help/matlab/ref/stlwrite.html#d120e1182467

6 days ago | 0

Answered

Index exceeds the number of arrays

Try to clear the variables, before using your code. There is no error in your code. It should work. clc; clear all; A = 4; W...

Index exceeds the number of arrays

Try to clear the variables, before using your code. There is no error in your code. It should work. clc; clear all; A = 4; W...

6 days ago | 0

| accepted

Answered

Adding Number using for loop

Let A be your n*2 array. t = A(:,1) ; s = A(:,2) ; [C,ia,ib] = unique(t) ; N = length(C) ; iwant = zeros(N,1) ; for ...

Adding Number using for loop

Let A be your n*2 array. t = A(:,1) ; s = A(:,2) ; [C,ia,ib] = unique(t) ; N = length(C) ; iwant = zeros(N,1) ; for ...

7 days ago | 0

Answered

peak Value of a spike in graph at a particular time

You reshape your array and use min and max. Read about reshape, min, max.

peak Value of a spike in graph at a particular time

You reshape your array and use min and max. Read about reshape, min, max.

7 days ago | 0

Answered

dynamic allocation of arrays

You can initiate it to a cell. resultPolygon = cell(720,1); for i = 1:720 newShaper = homogeneousTransformMatrix(phi(i))...

dynamic allocation of arrays

You can initiate it to a cell. resultPolygon = cell(720,1); for i = 1:720 newShaper = homogeneousTransformMatrix(phi(i))...

7 days ago | 0

| accepted

Answered

How can I save multiple matrix and index them?

txtFiles = dir("*.txt") ; N = length(txtFiles) ; themax = zeros(N,1) ; % loop for each file for i = 1:N data = import...

How can I save multiple matrix and index them?

txtFiles = dir("*.txt") ; N = length(txtFiles) ; themax = zeros(N,1) ; % loop for each file for i = 1:N data = import...

7 days ago | 0

| accepted

Answered

Crop out a section of the image in imshow, how?

Read about imcrop. Let I be your image. rect = [234 355 (1678-234) (764-355)] iwant = imcrop(I,rect) imshow(iwant)

Crop out a section of the image in imshow, how?

Read about imcrop. Let I be your image. rect = [234 355 (1678-234) (764-355)] iwant = imcrop(I,rect) imshow(iwant)

7 days ago | 0

| accepted

Answered

Plot multiples time series

Let A be your 365*40 data. Multiple options. plot(A) The above options plots 40 curves in one graph. It will be confusing. ...

Plot multiples time series

Let A be your 365*40 data. Multiple options. plot(A) The above options plots 40 curves in one graph. It will be confusing. ...

7 days ago | 0

Answered

Removing Missing Data from Corresponding Matrix

POCtotal(index,:)=[];

Removing Missing Data from Corresponding Matrix

POCtotal(index,:)=[];

8 days ago | 0

| accepted

Answered

Draw the trail of a moving marker on an animated 2D plot

A = rand(1800,1); B = rand(1800,1); % I'm just using dummy values here but my actual program has similar outputs (1800 x 1 dou...

Draw the trail of a moving marker on an animated 2D plot

A = rand(1800,1); B = rand(1800,1); % I'm just using dummy values here but my actual program has similar outputs (1800 x 1 dou...

8 days ago | 1

| accepted

Answered

Adding zeros to matrix

Let A be your 100*100 matrix. B = zeros(300) ; B(1:100,1:100) = A ;

Adding zeros to matrix

Let A be your 100*100 matrix. B = zeros(300) ; B(1:100,1:100) = A ;

8 days ago | 1

Answered

Obtain the mean angle (circle mean of a file)

num = xlsread(myfile) ; % better use readtable iwant = mean(num,2) ;

Obtain the mean angle (circle mean of a file)

num = xlsread(myfile) ; % better use readtable iwant = mean(num,2) ;

8 days ago | 0

Answered

How do I turn of thr grid of a surface but keep the edge line on?

[X,Y] = meshgrid(1:10) ; Z = sqrt(X.^2+Y.^2) ; % plot the outer line X1 = X ; X1(2:end-1,2:end-1) = NaN ; Y1 = Y ; Y1(...

How do I turn of thr grid of a surface but keep the edge line on?

[X,Y] = meshgrid(1:10) ; Z = sqrt(X.^2+Y.^2) ; % plot the outer line X1 = X ; X1(2:end-1,2:end-1) = NaN ; Y1 = Y ; Y1(...

9 days ago | 0

| accepted

Answered

How do I subplot multiple tiles that I divided from a satellite image in one figure?

count = 0 ; for m=1:16 for n=1:16 count = count+1 ; subplot(16,16,count); imshow(tiles{m,n}); ...

How do I subplot multiple tiles that I divided from a satellite image in one figure?

count = 0 ; for m=1:16 for n=1:16 count = count+1 ; subplot(16,16,count); imshow(tiles{m,n}); ...

9 days ago | 1

Answered

Changing the color of a 3D plot

This command: h = plot( fitresult); You specify a marker/ different color for both the functions. h = plot( fitresult,'b'); ...

Changing the color of a 3D plot

This command: h = plot( fitresult); You specify a marker/ different color for both the functions. h = plot( fitresult,'b'); ...

9 days ago | 0

Answered

Select points inside a polygon

You can use the previous questions answer..with a slight change while saving the points. clc; clear all ; load("polygon1_x.ma...

Select points inside a polygon

You can use the previous questions answer..with a slight change while saving the points. clc; clear all ; load("polygon1_x.ma...

9 days ago | 1

Answered

Velocity potential with quiver command

You should use gradient. [u,v] = gradient(StreamFunction) ; quiver(x,y,u,v)

Velocity potential with quiver command

You should use gradient. [u,v] = gradient(StreamFunction) ; quiver(x,y,u,v)

9 days ago | 0

Answered

Plot a box around set of points

This question can be solved from your previous question which was answered. If (x,y) is your point and you want points around ...

Plot a box around set of points

This question can be solved from your previous question which was answered. If (x,y) is your point and you want points around ...

9 days ago | 2

| accepted

Answered

how can i plot positive magnitude only of a sine wave

% get the index of only positive values idx = DC_Voltage>=0 ; plot(DC_Voltage(idx))

how can i plot positive magnitude only of a sine wave

% get the index of only positive values idx = DC_Voltage>=0 ; plot(DC_Voltage(idx))

9 days ago | 1

| accepted

Answered

i was writing a equation but this always have an error and i cant run it

You should first define the constants and then type the formula. T= 1000; L=10; W=100; S=100000; %% this is tha value of ...

i was writing a equation but this always have an error and i cant run it

You should first define the constants and then type the formula. T= 1000; L=10; W=100; S=100000; %% this is tha value of ...

9 days ago | 1

| accepted

Answered

Create a box around points and use in inpolygon

load("polygon1_x.mat") ; load("polygon1_y.mat") ; load("lon.mat") ; load("lat.mat") ; % remove Nan's from the data xv ...

Create a box around points and use in inpolygon

load("polygon1_x.mat") ; load("polygon1_y.mat") ; load("lon.mat") ; load("lat.mat") ; % remove Nan's from the data xv ...

9 days ago | 1

| accepted

Answered

How to use ginput to determine the coordinates of an image

You have dimensions of each image...say dimensions of each image [m,n,3]. Initiate a matrix idx such that, each quarter has the ...

How to use ginput to determine the coordinates of an image

You have dimensions of each image...say dimensions of each image [m,n,3]. Initiate a matrix idx such that, each quarter has the ...

10 days ago | 0

| accepted

Answered

how can i write the code out for this 1-1/2+1/3-1/4+1/5-,.....

It is your Home work..you have to do it. Do the following. Read about for loop. Fix the value of n, to run a loop. You can...

how can i write the code out for this 1-1/2+1/3-1/4+1/5-,.....

It is your Home work..you have to do it. Do the following. Read about for loop. Fix the value of n, to run a loop. You can...

11 days ago | 0

Answered

How to find the exact index(row, col) of a maximum value in a matrix?

Let I be your image. [m,n,p] = size(I) ; x = 1:n ; y = 1:m ; [X,Y] = meshgrid(x,y) ; [val,idx] = max(I(:)) ; imshow(I...

How to find the exact index(row, col) of a maximum value in a matrix?

Let I be your image. [m,n,p] = size(I) ; x = 1:n ; y = 1:m ; [X,Y] = meshgrid(x,y) ; [val,idx] = max(I(:)) ; imshow(I...

12 days ago | 0

| accepted

Answered

strength of materials in matlab

P = [0 0] ; L = 1000 ; % length of beam B = 0.5 ; % breadth of beam B = [P ; L P(2) ; L B ; P(1) B] ; patch(B(:...

strength of materials in matlab

P = [0 0] ; L = 1000 ; % length of beam B = 0.5 ; % breadth of beam B = [P ; L P(2) ; L B ; P(1) B] ; patch(B(:...

12 days ago | 0