Answered

plotyy: problem with ticks

Marco, still not quite sure about the end result. How about adding set(ax(1),'YLim',[minimum_left, maximum_left]) set(ax(2...

plotyy: problem with ticks

Marco, still not quite sure about the end result. How about adding set(ax(1),'YLim',[minimum_left, maximum_left]) set(ax(2...

etwa 3 Jahre ago | 1

| accepted

Answered

How to access number of rows in one step?

Try size(theMatrix,1)

How to access number of rows in one step?

Try size(theMatrix,1)

etwa 3 Jahre ago | 1

| accepted

Answered

how can i find the location of the largest element in a 2-D matrix not in a column or row matrix?

Navneet, e.g. A = [1 2 3; 2 3 4; 3 2 1] A = 1 2 3 2 3 4 3 2 1 [row,col] = fin...

how can i find the location of the largest element in a 2-D matrix not in a column or row matrix?

Navneet, e.g. A = [1 2 3; 2 3 4; 3 2 1] A = 1 2 3 2 3 4 3 2 1 [row,col] = fin...

etwa 3 Jahre ago | 1

| accepted

Answered

Help with solve please

Jonathan, use <https://www.mathworks.com/help/optim/ug/fsolve.html |fsolve|> instead.

Help with solve please

Jonathan, use <https://www.mathworks.com/help/optim/ug/fsolve.html |fsolve|> instead.

etwa 3 Jahre ago | 0

Answered

Problem about plotting 2D about multiple of functions

Amin, use instead y = floor(sin(x)) .* floor(x); % notice the period before the * This allows you to do element-wise mult...

Problem about plotting 2D about multiple of functions

Amin, use instead y = floor(sin(x)) .* floor(x); % notice the period before the * This allows you to do element-wise mult...

etwa 3 Jahre ago | 1

| accepted

Answered

rlocus showing overshoot, step showing none?

Robert, the overshoot information that is shown in the root locus plot needs to be taken with a grain of salt. It essentially on...

rlocus showing overshoot, step showing none?

Robert, the overshoot information that is shown in the root locus plot needs to be taken with a grain of salt. It essentially on...

etwa 3 Jahre ago | 0

Answered

How to redirect user if they enter an incorrect input

Bree, without knowing the structure of your program I would suggest using a <https://www.mathworks.com/help/matlab/ref/while.htm...

How to redirect user if they enter an incorrect input

Bree, without knowing the structure of your program I would suggest using a <https://www.mathworks.com/help/matlab/ref/while.htm...

etwa 3 Jahre ago | 2

Answered

Logical indexing: More than two conditions

Do you mean x = -10:10; y = (x>=0 & x~=2).*x.^3 + (x<0).*x.^2 + (x==2).*x

Logical indexing: More than two conditions

Do you mean x = -10:10; y = (x>=0 & x~=2).*x.^3 + (x<0).*x.^2 + (x==2).*x

etwa 3 Jahre ago | 2

| accepted

Answered

my laptop doesnt have enough storage for install the matlab ,there is no portable matlab available?

Elmira, depeding on your license you might have access to <https://www.mathworks.com/products/matlab-online/ MATLAB Online> and ...

my laptop doesnt have enough storage for install the matlab ,there is no portable matlab available?

Elmira, depeding on your license you might have access to <https://www.mathworks.com/products/matlab-online/ MATLAB Online> and ...

etwa 3 Jahre ago | 1

Answered

ode45 and additional parameters - Growth Equation

Victor, check out the following: function myODE() tspan = [0 25]; % y0 = [1 1]; % these are the initial conditi...

ode45 and additional parameters - Growth Equation

Victor, check out the following: function myODE() tspan = [0 25]; % y0 = [1 1]; % these are the initial conditi...

etwa 3 Jahre ago | 1

| accepted

Answered

How to draw a polar graph from r=0?

Yuval, looks like you only need to increase the number of data points (|theta|): theta = 0:0.001:2*pi; or something like ...

How to draw a polar graph from r=0?

Yuval, looks like you only need to increase the number of data points (|theta|): theta = 0:0.001:2*pi; or something like ...

etwa 3 Jahre ago | 0

| accepted

Answered

For simple transfer function getting different result in matlab code and simulink for same pid values.

Sadeep, Fig 1. looks very much like the step input (rather than the step response). Compare this figure to g = tf(1,1) g =...

For simple transfer function getting different result in matlab code and simulink for same pid values.

Sadeep, Fig 1. looks very much like the step input (rather than the step response). Compare this figure to g = tf(1,1) g =...

etwa 3 Jahre ago | 0

Answered

Trying to plot the surface and contour plot (surfc) of the temperature distribution of a 1x1 metal plate that goes from (0,0) to (1,1), while it's heated to 100 degrees C on the corner (1,1). THANK YOU!!

Brandon, use x = linspace(0,1); y = linspace(0,1); [xG,yG] = meshgrid(x,y); T = 100*(exp((-0.1)*((xG-1).^2))).*(exp((-0....

Trying to plot the surface and contour plot (surfc) of the temperature distribution of a 1x1 metal plate that goes from (0,0) to (1,1), while it's heated to 100 degrees C on the corner (1,1). THANK YOU!!

Brandon, use x = linspace(0,1); y = linspace(0,1); [xG,yG] = meshgrid(x,y); T = 100*(exp((-0.1)*((xG-1).^2))).*(exp((-0....

etwa 3 Jahre ago | 1

| accepted

Answered

Why wont the divide operator work?

Julia, are you showing all the code? Looks like the variable |a| is not defined. As for the plot command: one of the round br...

Why wont the divide operator work?

Julia, are you showing all the code? Looks like the variable |a| is not defined. As for the plot command: one of the round br...

etwa 3 Jahre ago | 0

Answered

My code is producing two answers, but it is only supposed to print one.

DJ, the function is only returning only one variable, |payment|. |pay2| is only displayed because there is no semi-colon afte...

My code is producing two answers, but it is only supposed to print one.

DJ, the function is only returning only one variable, |payment|. |pay2| is only displayed because there is no semi-colon afte...

etwa 3 Jahre ago | 0

Answered

Matlab function holding first value?

Hi Péter, this is explained well in the documentation <https://www.mathworks.com/help/matlab/matlab_prog/anonymous-functions.htm...

Matlab function holding first value?

Hi Péter, this is explained well in the documentation <https://www.mathworks.com/help/matlab/matlab_prog/anonymous-functions.htm...

mehr als 3 Jahre ago | 1

Answered

problem with reduceDifferentialOrder -> massMatrixForm -> odeFunction

Carlos, the <http://www.mathworks.com/matlabcentral/fileexchange/49796-euler-lagrange-tool-package Euler-Lagrange tool package> ...

problem with reduceDifferentialOrder -> massMatrixForm -> odeFunction

Carlos, the <http://www.mathworks.com/matlabcentral/fileexchange/49796-euler-lagrange-tool-package Euler-Lagrange tool package> ...

mehr als 3 Jahre ago | 0

Answered

phase plane in MATLAB?

Hello, check out the code below: function my_ODE() th0 = 0; Dth0 = 1; tspan = linspace(0,2,200); o...

phase plane in MATLAB?

Hello, check out the code below: function my_ODE() th0 = 0; Dth0 = 1; tspan = linspace(0,2,200); o...

mehr als 3 Jahre ago | 1

| accepted

Answered

Hi. I have a vector in simulink that need 1/3 as a exponent. How can i do that?

Andrea, you can use * a |Math Function| block (in |Math Operations| library), open the block and select function |pow| * or ...

Hi. I have a vector in simulink that need 1/3 as a exponent. How can i do that?

Andrea, you can use * a |Math Function| block (in |Math Operations| library), open the block and select function |pow| * or ...

mehr als 3 Jahre ago | 0

Answered

Hi, what should I do to get the 'Not enough input arguments'-error,

Rebecca, yes. Use something like function d = inputErrorCheck(a,b,vargin) switch nargin case 3 if ...

Hi, what should I do to get the 'Not enough input arguments'-error,

Rebecca, yes. Use something like function d = inputErrorCheck(a,b,vargin) switch nargin case 3 if ...

mehr als 3 Jahre ago | 0

Answered

If I have a matrix of 100 rows by 5 columns, how can I make it a 1 row x 500 column matrix, where each row (1x5) is placed one after the other to make a 1x500 matrix?

Use the <https://www.mathworks.com/help/matlab/ref/reshape.html |reshape|> command.

If I have a matrix of 100 rows by 5 columns, how can I make it a 1 row x 500 column matrix, where each row (1x5) is placed one after the other to make a 1x500 matrix?

Use the <https://www.mathworks.com/help/matlab/ref/reshape.html |reshape|> command.

mehr als 3 Jahre ago | 0

Answered

How to use fmincon on an symbolic integral function

Sylvia, use <https://www.mathworks.com/help/matlab/ref/integral2.html |integral2|> in combination with |fmincon|.

How to use fmincon on an symbolic integral function

Sylvia, use <https://www.mathworks.com/help/matlab/ref/integral2.html |integral2|> in combination with |fmincon|.

mehr als 3 Jahre ago | 0

Answered

Problem with using ode45 event option

Sourav, you need to improve the accuracy of the integration. E.g. this seems to work: options = odeset('RelTol',1e-7,'AbsTol...

Problem with using ode45 event option

Sourav, you need to improve the accuracy of the integration. E.g. this seems to work: options = odeset('RelTol',1e-7,'AbsTol...

mehr als 3 Jahre ago | 0

| accepted

Answered

problem with symbolic to function handle

How about syms x y z f = x*y*z+x*2*y; G = gradient(f); m = matlabFunction(G); [X,Y,Z] = meshgrid(-3:1:...

problem with symbolic to function handle

How about syms x y z f = x*y*z+x*2*y; G = gradient(f); m = matlabFunction(G); [X,Y,Z] = meshgrid(-3:1:...

mehr als 3 Jahre ago | 1

Answered

How can I graph all the values of n in the while loop ? Theres my program.

Something like this? Not quite sure what you want your x-axis to be. n = input('Enter a natural number'); cont=1:1:n; ...

How can I graph all the values of n in the while loop ? Theres my program.

Something like this? Not quite sure what you want your x-axis to be. n = input('Enter a natural number'); cont=1:1:n; ...

mehr als 3 Jahre ago | 0

Answered

How do i install add-on package?

In the recent MATLAB releases it is in the toolstrip on the very top of the window. Find the |ENVIRONMENT| section and the |...

How do i install add-on package?

In the recent MATLAB releases it is in the toolstrip on the very top of the window. Find the |ENVIRONMENT| section and the |...

mehr als 3 Jahre ago | 0

Answered

I get Subscripted assignment dimension mismatch.

Use instead wave(n,:) = (A(n))*sin(2*pi*(f(n))*T); plot(T,wave(n,:),'b') You also might want to think about pre-alloc...

I get Subscripted assignment dimension mismatch.

Use instead wave(n,:) = (A(n))*sin(2*pi*(f(n))*T); plot(T,wave(n,:),'b') You also might want to think about pre-alloc...

mehr als 3 Jahre ago | 0

| accepted

Answered

function handle parameterization interval

Georg, you could use something like l_1 = 1; l_2 = 2; radius = 0.5; psi = 0.2; t = -1:0.01:5;...

function handle parameterization interval

Georg, you could use something like l_1 = 1; l_2 = 2; radius = 0.5; psi = 0.2; t = -1:0.01:5;...

mehr als 3 Jahre ago | 0

| accepted

Answered

Creating a pushbutton and callback function

Try function myButtonTest() PushButton = uicontrol(gcf,'Style', 'push', 'String', 'Next','Position', [300 10 30 30],...

Creating a pushbutton and callback function

Try function myButtonTest() PushButton = uicontrol(gcf,'Style', 'push', 'String', 'Next','Position', [300 10 30 30],...

mehr als 3 Jahre ago | 0

| accepted

Answered

symbolic calculations for physical system doesn't give apropriated answer.

Check out the <http://de.mathworks.com/matlabcentral/fileexchange/49796-euler-lagrange-tool-package Euler-Lagrange tool package>...

symbolic calculations for physical system doesn't give apropriated answer.

Check out the <http://de.mathworks.com/matlabcentral/fileexchange/49796-euler-lagrange-tool-package Euler-Lagrange tool package>...

mehr als 3 Jahre ago | 0

| accepted