Answered
Making the consecutive values which are less then 4 columns NaN
idx = A(2:3,:)<4 ; % get the logical indices of 2, 3 row which are less than 4 idx = [zeros(1,size(A,2));idx] ; % extend th...

5 years ago | 0

Answered
set order of elseif
Are you looking something like this. if z %code for case z order = ['case','z'] ; elseif x %code for cas...

5 years ago | 0

Answered
Is there any way i can make measurements on a plot?
x = [0.01, 0.02, 0.029999999999999999, 0.040000000000000001, 0.050000000000000003, 0.059999999999999998, 0.070000000000000007,...

5 years ago | 0

Answered
How to extract gray scales from pixel x and y?
Read about rgb2gray. You can convert your RGB image to gray using that function.

5 years ago | 0

Answered
How to fix this error?
If you want to open .fig file. openfig('DSBSCfig.fig') If you want to run the .m file, open it and press F5 or press the run ...

5 years ago | 0

Answered
Calculating euclidean distances in a matrix
% demo data n = 100 ; A = rand(n,2) ; dA = diff(A) ; d = sqrt(sum(dA.^2,2)) ;

5 years ago | 1

Answered
Draw mode shape using Eigen values for a building
You have the Eigenvectors right...... plot them using plot command.

5 years ago | 1

| accepted

Answered
3d plot help
Something like this: z1 = rand(10,1) ; z2 = rand(10,1) ; x1 = 1:length(z1) ; x2 = 1:length(z2) ; y1 = repmat(1,siz...

5 years ago | 0

Answered
2 Variable increment in one "for Loop'
for i = 1:10 for j = 1:2:20 [i j] end end

5 years ago | 0

Answered
roots() function does not give exact roots
p = [1 -3 3 -1] ; poly = poly2sym(p) r = solve(poly==0) % using roots r = roots(p) ; real(r)

5 years ago | 2

Answered
How to use the three points A1, A2, and B0 to calculate ∠A1B0A2?
A1 = [171 422] ; A2 = [415 413] ; B0 = [277 386] ; d1 = A1-B0 ; d2 = A2-B0 ; theta = atan((d2(2)-d1(2))/(d2(1)-d1(1)))

5 years ago | 0

| accepted

Answered
2D plot of x*sin(1/x)
x = [-1/pi:0.01:1/pi]; y = x.*(sin(1./x)); %<------ element by element operation plot(x,y)

5 years ago | 0

| accepted

Answered
shading plots between one standard deviation
If (x1,y1) and (x1,y2) are tow data, with x1 increasing montonically. I assume they are column arrays. I assumed both of them ar...

5 years ago | 0

Answered
Help Plotting Moving Object
What literature you will get on drawing moving objects? It is simple ain't it? You need to have a object first i.e. you need to ...

5 years ago | 0

Answered
logical operators with while loop
x = 2 ; while ~(mod(x,13) == 0 && sqrt(x)>=86) x = x+2 ; end fprintf('The required number is %d\n',x);

5 years ago | 2

Answered
Matrix dimensions must agree.
It should be exp() not exp.()..there is a typo error. %Data L=1; %m p=1; %kg/m^3 G=0.1; %kg/ms u=0.1; %m/s %Boundary Cond...

5 years ago | 2

| accepted

Answered
How can I connect the points on this graph
clc; close all; bits = [1,0,0,1,1,1,0,0]; l = length(bits); a = 1; z = 0; Y = zeros([],1) ; count = 0 ; for i=1:2...

5 years ago | 0

Answered
Plot base on index column
You can plot something like this: A = [1 2 10 1 3 10 1 5 10 2 2 10 2 3 10 2 5 10 3...

5 years ago | 1

Answered
Generate matrix with a pattern
I = eye(3) ; iwant = repmat(I,1,4)

5 years ago | 2

| accepted

Answered
replace values in an array with certain numbers
You can get the logical indices by using: idx = A >=0 & A< 1 ; % logical indices A(idx) = 500 ; % repalces them Follow...

5 years ago | 1

| accepted

Answered
colored mesh after scatter3 command
Read about delaunayTriangulation. Also have a look on this package: https://in.mathworks.com/matlabcentral/fileexchange/25555-...

5 years ago | 0

Answered
How to find center position of image??
I = imread("image.jpeg") ; [y,x] = find(I==255) ; C = [mean(x) mean(y)] ; imshow(I) hold on plot(C(1),C(2),'*r')

5 years ago | 1

Answered
How to extract the common values only between two variables?
load Points.mat ; load Polyline.mat ; m = length(network) ; n = length(sedsource) ; P = cell(n,1) ; iwant = cell(n,1) ; ...

5 years ago | 0

Answered
For loop outputs into Row Vector
s =1473687476902629535821802641425569585752815039365228611687 r = 6 ; a = 7 ; r = 0:r ; iwant = zeros(length(r),1) ; f...

5 years ago | 0

Answered
Creating L points with uniform spacing d?
L=32; d = 0.063 ; px = zeros(L,1) ; px(1) = -d*L/2 ; for i = 2:L px(i) = px(i-1)+d ; end

5 years ago | 0

Answered
Creat a matrix using 2 while loops?
m = 10 ; n = 11 ; x = 1:m ; y = 1:n ; A = y'*x ; iwant = num2cell(A,2)

5 years ago | 0

Answered
anyway to color 2D triangular plot with "CData"
Read about trisurf. Also have a look on patch. You can use any of the two to achieve what you want.

5 years ago | 0

Answered
How to calculate hourly observation?
You can use interp1 to get what you want. Read the excel file. To read the exel file use readtable. Convert your time into...

5 years ago | 0

| accepted

Answered
What does this code do
[row,c]=size(x); % get dimensions of x s=1; % s takes the value 1 for i=5:9:last_index % Array index values takes from ...

5 years ago | 1

| accepted

Answered
Superimposing a line plot onto a contour plot using data from excel
A = xlsread("Contour.xlsx") ; x = A(1,2:end) ; y = A(2:end,1) ; Z = A(2:end,2:end) ; contourf(x,y,Z)

5 years ago | 0

| accepted

Load more