Answered
Breaking a single matrix to multiple matrix.
A = rand(100,3) ; [r,c] = size(A); p = 100/2; % this gives 50 out = permute(reshape(A',[c,r/p,p]),[2,1,3]);

6 years ago | 0

| accepted

Answered
can anyone find the error?
Save the function in a folder...and : a = 1 ; b = 2 ; c = 3 ; % define your variables quadratic(a,b,c)

6 years ago | 1

Answered
Sorting an array without sort() command
https://in.mathworks.com/matlabcentral/answers/439777-sorting-numbers-in-the-list-without-using-sort-command https://in.mathwo...

6 years ago | 0

Answered
Index exceeds the number of array of elements error
clear; clc; max = input('Enter limit for vector: '); askingPrice = input('Enter the asking price: '); n = 1; count1 = 0; %s...

6 years ago | 0

Answered
Unable to perform assignment because the left and right sides have a different number of elements.
Please note that the error is simple...this occurs when you try to save more number of elements than intialized into an array. ...

6 years ago | 0

Answered
Drawing an arc between two elements?
L1=[1 3; 1 6] L2=[-2 2; 8 -1] P=InterX(L1,L2); L = [L2(:,1) P L1(:,2)] ; p = polyfit(L(1,:),L(2,:),2) ; xi = lins...

6 years ago | 0

| accepted

Answered
Double Interpolation from a table
Vq=interp2(x,y,z',m_dot_exhaust(1),T_avg_rankine(1)) ;

6 years ago | 0

| accepted

Answered
calculate surface area from xy coordinates (R2017a)
Let (x,y) be your coordinates.... idx = boundary(x,y) ; bx = x(idx) ; by = y(idx) ; A = polyarea(bx,by) ;

6 years ago | 0

Answered
Index exceeds matrix dimensions. Error in LT_03 (line 98)
Note that for your formula given you need not to use loop...you can striaght away use: Fk =(f01+f02+f03+f04+f05+f06+f07+f08+f0...

6 years ago | 1

Answered
Locating Row and Column of Min. Value
[row column]=find(x==k,1)

6 years ago | 0

Answered
Calculation across rows without FOR LOOP
B = table([1;1;1;1;1;2;2;2;3],[1;2;3;4;5;6;7;8;500]); B.Var3 = zeros(height(B),1); i = [false; B.Var1(1:end-1) == B.Var1(2:end...

6 years ago | 0

| accepted

Answered
plotting 3 variables in figure
First you have to laod the .mat file into MATLAB. For this you can use load. Read abotu this function. To plot, you need to kn...

6 years ago | 0

| accepted

Answered
How do I plot a function in terms of another function?
Try this: a = 0:0.01:alphamax; %prof's work figure(5); clf for i=1:length(a) dt(i) = double(subs(eq1(a(i),z))); % ver...

6 years ago | 0

Answered
How to change only one input if needed?
prompt = "Enter number greater than 5 " ; m = input(prompt) ; while m > 5 m = input(prompt) ; end

6 years ago | 0

Answered
Sum modified laplacian operator
for p = 2:255 for q = 2:255 % do what you want end end

6 years ago | 0

Answered
2-D Truss Analysis
Repalce this line: NodePoly=[x ;y ;z]; with NodePoly=[x y z];

6 years ago | 0

Answered
How to display the value of output on plot?
Read about text. With this function, you can specify the string str by providing location (x,y). At this position (x,y) you can ...

6 years ago | 0

Answered
Finding the intersec point using InterX?
You should read the documentation/ help given in the InterX function. Your curves/ data points should be such that : L1 = [x11 ...

6 years ago | 1

| accepted

Answered
plotting 2 graphs on the same axes
Read about hold on. plot(rand(1,10)) hold on plot(rand(1,10))

6 years ago | 1

Answered
how to find values of y for a given x when both are arrays?
Let (x,y) be data you have. And you want to find yi for given xi. For this you have to do interpolation. Read about interp1. yi...

6 years ago | 0

| accepted

Answered
Make series in matrix
x = 1:5 ; p = 1:5 ; A = x'.^p ; %% A = repmat(x,5,1) ; B = (A'.^p)'

6 years ago | 0

| accepted

Answered
what is wrong?
x=-3:0.1:3 y=sin(x).*cos(2*x)+1 ; % element by element multilication plot(x,y)

6 years ago | 0

Answered
Randomly Shuffle X and Y
Read about randperm. y = 1:5 ; n = length(y) ; idx = randperm(n) ; y(idx)

6 years ago | 0

Answered
Seek: more efficient implementation
function H_L1 = H2_GFL(N, max_periods) num_rows = max_periods * N; H_L1 = zeros(num_rows, 2, N); rand_supply = rand(num_ro...

6 years ago | 0

Answered
how can i generate 4 nodes lie in a straight line, and how to find midpoint between first and last point. Thank you
You need any two points to get a striaght line. So I am selecting two random points to plot a line here. % Random points to pl...

6 years ago | 0

Answered
Generate Specific noise(i.e. 60 or 70 Hz) Matlab
L = 60 ; % Length in sec f = 60 ; % Frequency in Hz...

6 years ago | 0

Answered
Interpolation and curve line
x=[-5 -4 -3 -2 -1 0 1 2 3 4 5]; y=[0 .254 .508 .762 1.016 1.27 1.016 .762 .508 .254 0]; % Interpolation xi = linspace(min(x...

6 years ago | 0

Answered
How to plot min and max values on graph
X = 0:0.1:10; Y = (X.^(1.01))+4*cos((3/4).*X.*pi) - 2*sin((2/3)*pi.*X)-0.25; % min [val0,idx0] = min(Y) ; % max [val1,id...

6 years ago | 1

| accepted

Answered
loop to count amount sin(x)>0.5 when 1>x>1000
To get what you want loop is not required. x = linspace(1,1000,10^5) ; y = sin(x) ; nnz(y>0.5) If you want loop: % loo...

6 years ago | 0

| accepted

Answered
Can you solve this??
You can read about roots, solve. I suggest you to read the function roots.

6 years ago | 0

Load more