Community Profile

# KSSV

##### Last seen: Today
7,939 total contributions since 2011

Professional Interests: Mathematical Computing

View details...

Contributions in
View by

Function function/ passing function/ varargin help?
a = 8 ; b = 0.25 ; c = 2 ; n = 180 ; f = @(t) a*exp(-b*t).*sin(t-c); t = linspace(a,b,n); y = f(t); fdiff = ma...

24 minutes ago | 0

How to use previous points calculated from a function.
You can solve the given equation: R = d2*(t2-t1)/(d1-d2) ; for d2 and solve it to get d2. We have d2 as: d2 = R*d1/(R-t1+t2) ...

1 hour ago | 0

How to solve a set of equations with a vector as input
n = 1000 ; P = linspace(0,50,n) ; wm = (P./k).^(1/3); ws = wm / (-1.008); Ir = sqrt(P/(-0.567); % this will be com...

20 hours ago | 1

| accepted

In Matlab, after plotting a figure then I select a range of area and replot again
Yes you can very much do it.... If you have limits/ range for x-axis; you can limit your range in the existing plot using xlim,...

22 hours ago | 0

y'=1-(y/x), y(2)=-1, change in x =0.5. Im supposed to use Euler method to solve this differential equation but I'm not getting the answer I want. I have the code but I'm not sure if I'm doing it right.
Your x value is not correct: You need to check this line: x = 2:h:1.5; % the range of x In the above you need to make changes....

23 hours ago | 0

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]);

1 day ago | 0

| accepted

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)

1 day ago | 0

Sorting an array without sort() command

1 day ago | 0

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...

1 day ago | 0

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. ...

1 day ago | 0

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...

1 day ago | 0

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

1 day ago | 0

| accepted

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) ;

2 days ago | 0

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...

2 days ago | 1

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

2 days ago | 0

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...

2 days ago | 0

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...

2 days ago | 0

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...

2 days ago | 0

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

2 days ago | 0

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

2 days ago | 0

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

2 days ago | 0

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 ...

2 days ago | 0

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 ...

3 days ago | 0

| accepted

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

3 days ago | 0

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...

3 days ago | 0

| accepted

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

3 days ago | 0

| accepted

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

3 days ago | 0

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

3 days ago | 0