Answered
Need help with 3-d graph
Use <http://www.mathworks.com/help/matlab/ref/pol2cart.html |pol2cart|>, see, for example, the first example <http://www.mathwor...

12 years ago | 0

| accepted

Answered
The query regarding the error ' Z must be a matrix, not a scalar or vector.'
Hello Amit, you need to turn your data vector into an array. I assume, each of the 65536 data points corresponds to one particul...

12 years ago | 2

Answered
varible duty cycle square wave
Baran, there are a couple of blocks on <http://www.mathworks.de/matlabcentral/fileexchange/20251-pulse-generator-with-variable-f...

12 years ago | 0

Answered
Changing default values for inputdlg()
Michael, does this do what you need? defaultanswer = {'20','hsv'}; for ii = 1:2 prompt ={'Enter the matrix siz...

12 years ago | 0

| accepted

Answered
how to plot a semi-stable solution to autonomous DE
Will, the problem is that the system is unstable for |y0 > 1|. E.g., for |y0 = 2| the derivative dy/dt = k(1 - y)^2 at |...

12 years ago | 0

| accepted

Answered
how to convert time in its standard form to seconds?
Use <http://www.mathworks.com/help/matlab/ref/datenum.html |datenum|>. t1 = '12:45:07'; t2 = '13:45:07'; dt_sec = round(...

12 years ago | 2

| accepted

Answered
error message coming like string argument is an unknown option?how to plot a 3 D graph?
An, use |plot3| for 3D graphs: plot3(v,u,E2,'green') hold on plot3(v,ug,E2g,'red') box; grid;

12 years ago | 0

Answered
roots of complex numbers
Harley, use sol = ((125/2)*(1-sqrt(3i)))^1/3 There is no need to do it symbolically.

12 years ago | 0

| accepted

Answered
matrix element in summation sign
Lo, use syms a b c d e f A = [a; b; c]; B = [d; e; f]; sum(A.*B)

12 years ago | 0

Answered
Varying parameters in if statement
Something like: mynum = 2; % change to mynum = 1 x10 = 1; word = 'x'; i = 10; if (eval(genvarname(strc...

12 years ago | 0

Answered
How to create impulse from timestamps?
You could also do x = [1 11 21 31 41 51 61 71 81 91]; n = 11; a = x==n;

12 years ago | 0

Answered
Why am i getting this error in the following line of code?
Rizwana, in this case use name = inputdlg ('Enter a name for the folder (single quotes): '); mkdir (name{1}); Note the...

12 years ago | 1

| accepted

Answered
ERROR: "Undefined function or method for double type" + "feval error" - Strange case/no plots
It looks like your ODE function is called |F__CubeSat_rocket|: function ydot = F__CubeSat_rocket(t,y) However, you are c...

12 years ago | 0

| accepted

Answered
Finding the mean of a matrix row? Get error "Subscript indices must either be real positive integers or logicals."
Use A = mean(Xtcounter,2) B = std(Xtcounter,0,2) C = kurtosis(Xtcounter')'

12 years ago | 1

| accepted

Answered
try to keep track of the plot in a loop? how to do that?
William, a couple of things. See inlined comments: function M = MonodromyM() % M is outputted by function and available f...

12 years ago | 0

| accepted

Answered
Trying to input values into function with previously symbolically defined variables and plot the function, but getting error
David, try ... %Plotting High-Pass Gain vs Angular Frequency ww = logspace(1,5,100); Rah_v = 10; Rbh_v = 10; ...

12 years ago | 0

Answered
Code running time calculation
Alina, use |tic| at the beginning, and |toc| at the end of the part of the code you want to measure execution time of. E.g., ...

12 years ago | 0

Answered
help with writing an equation with iterations
Ken, you could do: alpha = 30; n = 10; for i = 1:n theta(i) = 8*alpha(i)*i + 6*alpha(i); alpha(i+1) = t...

12 years ago | 0

Answered
building a square matrix out of a vector
Hossein, use |reshape|: A = 1:4*4; n = sqrt(length(A)); % if A is indeed an n*n vector B = reshape(A,n,n)

12 years ago | 0

| accepted

Answered
how do I solve for a dependent variable then display that answer?
Ryan, simply remove the semi-colon after the |vpasolve| command vpasolve((V*D1)+(D2*V.^2)+(D3*V.^3)+(D4*V.^4)+(D5*V.^5)+(D6*...

12 years ago | 0

| accepted

Answered
How to find the 'delta' between two equations?
If I understand correctly your are looking for values of |x| and |y| that result in different |z| values for the two equations. ...

12 years ago | 0

Answered
How can I loop into a matrix?
I assume you are trying to do something like for ii = 1:6 S{ii} = [1 -v(ii) 0; v(ii) 1 0; 0 0 2*(1+v(ii))]/E(ii); en...

12 years ago | 0

| accepted

Answered
creating square wave problem
Use if (0<=u && u<0.5) and accordingly for all the other |if| statements.

12 years ago | 0

| accepted

Answered
Getting a ' Undefined function 'mtimes' for input arguments of type 'cells' ' error
Michael, use m = str2num(answer{1});

12 years ago | 0

| accepted

Answered
Undefined function 'sind' for input arguments of type 'sym'.
Yep, you need to use |sin|. Convert angles in degrees to rad via angle_rad = angle_deg * (pi/180); As an example syms...

12 years ago | 1

Answered
X and Y Labelling
Just use the *exact same* code as for the first figure: xlabel('Distance(mm)'); % remove xlabel1 = ylabel('Delta(0kg)'...

12 years ago | 0

| accepted

Answered
Help with symbolic variables
Tom, do you mean something like Plm_vec(i,:) = subs(Plm(i,:),{theta},{[pi/4, pi/5, pi/6]});

12 years ago | 0

| accepted

Answered
Undefined function 'nanmean' in MATLAB R2013b
Beatriz, you possibly have not installed/licensed the corresponding toolbox(es). What do you get when you execute in the MATLAB ...

12 years ago | 2

| accepted

Answered
matrix row and cloumn exchange
Alina, use b = reshape(a',2,4)'

12 years ago | 0

| accepted

Answered
Plot time vector in x axis
Chani, you can simply just plot <http://www.mathworks.com/help/matlab/ref/plot.html#inputarg_LineSpec markers>, e.g., note the |...

12 years ago | 0

Load more