Answered
How to return elements of 'A' using indices of 'B' ?
a = thigh_orient_y ; b = shank_orient_y ; idx = main_peak_location ; n = length(idx)-1 ; iwant = cell(n,1) ; for i ...

4 years ago | 0

| accepted

Answered
How to plot different y values for different x values, provided the x and y values are to be generated in a loop?
As you are plotting a point, you need to use marker. n=100; b=6.9; r=5; y=(r-1)+0.5; e=0;z=2; U=9000; figure hold on f...

4 years ago | 0

Answered
How to use logical indexing to return parts of an array that matches the elements of another array?
Read about findpeaks. It will give you the indices and values of peaks; using the indices you can get yopur required values.

4 years ago | 0

| accepted

Answered
How to generate random points in a 3d line, if two end points are known??
A = [ 0, 0, 405] ; B = [ 4.5, -5.5, 480] ; AB = B-A ; % vector t = sort(rand(1,100)) ; % random points % Parametri...

4 years ago | 0

| accepted

Answered
Convert convexhull to stl file
p = [113.6466 111.8984 112.4205 108.7094 113.4748 111.4158 113.5684 ]; q =[ 17.7346 12.7025 16.5175 18.2938 17.43...

4 years ago | 0

| accepted

Answered
Array indices must be positive integers or logical values
t=0:0.1:1; nt = length(t) ; xt = zeros(nt,1) ; for i = 1:length(t) xt(i) = (-0.05)*t(i)^5+0.25*t(i)^4+t(i)+2-exp(-t(i)...

4 years ago | 0

| accepted

Answered
Index in position 2 exceeds array bounds. Index must not exceed 1. Error in metal6 (line 60) M4=[m411(1,j),m412(1,j);m421(1,j),m422(1,j)];
Few of your variables like m212, m312, m412 are scalars i.e. 1x1 size and you are treating them as vectors and extracting more n...

4 years ago | 0

| accepted

Answered
How to make my quiver plot readable?
You have limited the axes to a large extent. Don't limit the axes. Remove these lines: xlim([0 360]); ylim([0 360]); Let MATL...

4 years ago | 0

| accepted

Answered
Cell-Array operation in large Cell-Array (Vectorization?)
Read about erase. https://in.mathworks.com/help/matlab/ref/erase.html#:~:text=newStr%20%3D%20erase(%20str%20%2C%20match%20)%20...

4 years ago | 1

Answered
How to select and plot the maximum point in several pixels
A = rand(4096,104,60) ; B = permute(A,[2 1 3]) ; B_max = max(B,[],3) ; imshow(B_max)

4 years ago | 0

Answered
alignment issue in fprint
P=[65.44; 87.12; 67.46; 79.51]; words1={'Moisture';'Fixed carbon';'Volatile matter';'Ash'}; words2 = repmat({'wt%'},length(P),...

4 years ago | 1

Answered
Trying to stack an image array, error "Unable to perform assignment because the size of the left side is 220-by-220 and the size of the right side is 256-by-256"
If you RHS image is 3D and if the dimensions of each image are different, then you cannot save them into a matrix. So save them ...

4 years ago | 0

| accepted

Answered
How to plot several 3D funztions (Z_n=f_n(x,y) with arbitrary intervals for each of them in one coordinate system?
It is plotting both the surfaces, but they are in the same colormap and you are unable to differentiate them. Check this: figur...

4 years ago | 1

Answered
How to calculate the area of specific path under the curve?
Read about trapz.

4 years ago | 0

Answered
Create a Matrix from defined variables
c1=440 ; c2=250 ; r1= 50 ; r2=25 ; C=[c1*r1^2, c1*r1*r2, 0; c1*r2*r1, c2+c1*c2^2, -c2; 0, -c2, ...

4 years ago | 0

| accepted

Answered
Can I use my CPU and GPU simultaneously for Numerical Simulation?
DEfault code runs in CPU unless you specify the code to run in GPU. To run code in GPU you need to convert the variable/ stage t...

4 years ago | 0

Answered
How to plot mode shapes from eigen vectors of a cantilever beam.
Read about polyfit. Also have a look on this file exchange: https://in.mathworks.com/matlabcentral/fileexchange/30970-natural-...

4 years ago | 0

| accepted

Answered
i am new to matlab and i want to learn, can anyone help me with this please!!!
https://in.mathworks.com/matlabcentral/answers/305169-what-is-the-code-for-lagrange-interpolating-polynomial-for-a-set-of-given-...

4 years ago | 0

| accepted

Answered
Boundary/polygon around coastline of Greenland
You can get the coastline using the function contour. Read about it. [M,c] = contour(x,y,Z,[0 0]) ; % M has the coordinates yo...

4 years ago | 0

| accepted

Answered
Renaming a Excel file from an array
All_values=values; for i =1:numel(All_values) values=All_values(i) T = table(a{1,i}.time, oo{1,i}.signals.values, pp{...

4 years ago | 0

Answered
Symbolic Expression Error problem !
Proceed with loop. %% Numeric Value Code FFF = rand(8,2); TTT = rand(2,2); FFF = reshape(FFF, 4, 2, []); TTT = reshape(TT...

4 years ago | 0

| accepted

Answered
can anyone help me with this function.. i'm new to matlab and i need this for my research
You have to provide the inputs to the function. It seems you are either calling the function without providing inputs or running...

4 years ago | 0

Answered
function solve return 'Unable to perform assignment because the left and right sides have a different number of elements.'
hs_data = hs_Lderiv./1000; %meter t_data = t; %seconds dh = diff(hs_data); dt = diff(t_data); syms gamma dhdt = zeros(size(...

4 years ago | 1

Answered
How can I make the loop operation to give only 1 answer for each iteration? Here's my program that i tried out but it keeps giving me more than 2 answer of each iteration.
f=0; while f<0.1 f=f+0.0000001; Re=10^((1/sqrt(f)+0.537)/1.930)/sqrt(f); count = 0 ; for x=25000:-5000:500...

4 years ago | 0

Answered
Waves mode summation for a string
xs=8; v=3; L=20; ta=0.2; t=1; n=1:1:40; x=0:0.1:20; omga = zeros(1,length(n)) ; F = zeros(1,length(n)) ; u = zeros(le...

4 years ago | 0

| accepted

Answered
Subs command substituting the values of variables that was earlier define symbolic but when I am using plot command error message came "Non numeric data"
Convert the symbolic class into double using the function double. Read about it.

4 years ago | 0

| accepted

Answered
how can i make an axis logarithmic
Read about loglog.

4 years ago | 0

Answered
Split a vector into 2 vector before and after a value is found
a=[0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8] ; val = 0.5 ; idx = find(a==val) ; a1 = a(1:idx-1) a2 = a(idx:end)

4 years ago | 0

| accepted

Load more