Question

Finding all the zeroes of a discontinuous function in a particular range

I am trying to find the zeroes of the following symbolic function. syms x moment =20*heaviside(x - 8)*(x - 8) - (3*x^2*heavis...

1 hour ago | 1 answer | 0

Question

Determining the roots, maxima, and minima of a discontinuous symbolic function

How can the roots of the following discontinuity function be determined? syms x f =(x^3*heaviside(x))/18 - (3*x^2*heaviside(...

18 hours ago | 0 answers | 0

Question

Evaluating a symbolic heaviside function using subs at points where disconuities are located

When trying to evaluate a symbolic function, Matlab outputs 'Nan' when it encounters discontinuities. syms x f = 22*heavisid...

21 hours ago | 0 answers | 0

Question

Solve a system of nonlinear equations symbolically

The following code is meant to solve a system of nonlinear equations. syms do K eq1 =(5e-5)^2 - (do)^2 == K*25*60; eq2 = (7....

6 days ago | 1 answer | 0

Question

Plotting the heaviside discontinuity function

The plot generated by the following code is not always the same and sometimes somewhat inaccurate. For example, there should be ...

15 days ago | 1 answer | 0

Question

Array indices must be positive integers or logical values error when using cell arrays

The following code is supposed to add a function of x to a function handle f whose coefficients depend on the entries of a cell ...

15 days ago | 1 answer | 0

Question

Accessing 1 by n array from a cell array

The output of the following code is the cell array poh. Is there a way to instead access the first subarray {'poh',3,4.56} throu...

15 days ago | 1 answer | 0

Question

Accessing elements of lists within lists

I have created a list which contains several lists in the following code. a = [{'poh',3,4},{'v',5}] a=[{'poh',3,4},{'v',5}] ...

19 days ago | 1 answer | 0

Question

Function to chop a decimal to a variable number of digits

I wrote the following function to approximate a number using chopping arithmetic. chop(5,4.333352312) function output = ...

24 days ago | 2 answers | 0

Question

Format coefficients of the derivative of a function

The following code is meant to output the derivative of a function but the coefficients are displayed as fractions even when I t...

24 days ago | 1 answer | 0

Question

Incorrect plot domain when using linspace

The plot generated by the following code should have a domain from 0 to 5 but instead each x value is multiplied by a factor of ...

1 month ago | 1 answer | 0

Question

Finding x and y values of a point on a Simulink plot

I am trying to determine the x and y values of certain points on a Simulink temperature entropy plot. Normally when I hover over...

1 month ago | 1 answer | 0

Question

Modelling Open Circuit Test of Single Phase Transformer using Simulink

I am trying to model the open and short circuit tests using Simulink but certain blocks and objects are missing. For example, wh...

1 month ago | 1 answer | 0

Question

Format a matrix with entries displayed as exact values

I am trying to print a matrix with its entries displayed as exact values not fractional approximations. For example, the followi...

1 month ago | 1 answer | 0

Question

Using plot3 to plot 3d vectors

The following code is meant to plot the vectors (4,5,6), (-3,6,-3) and (1,2,3) directed from the origin. plot3([0 4], [0 5], ...

2 months ago | 1 answer | 0

Question

Saving a file in Matlab R2020a

I recently installed Matlab R2020a on my Windows 10 laptop and whenever I create a script or function file and click "Run" I am ...

2 months ago | 1 answer | 0

Question

Cannot call or index into a temporary array error message

I am trying to access the elements of a 1 by 2 variable that is defined by a function handle, p2r, but when I define a separate ...

6 months ago | 0 answers | 0

Question

Solving a system of equations involving complex numbers

The following code outputs a value for a and b with respect to the imaginary number i but the output is not fully simplified wit...

6 months ago | 1 answer | 0

Question

Simplifying solution to algebraic system of equations

The following code outputs a value for a and b with respect to the imaginary number i but the output is not fully simplified wit...

6 months ago | 1 answer | 0

Question

Solving a symbolic equation in one or more variables

When the following code is executed, the output is ans = Empty sym: 0-by-1 although b = i = yp = [1 90] I get the same re...

6 months ago | 2 answers | 0

Question

Defining a symbol to perform a specified operation

Is there a way, for example, given two numbers a and b I can either use a function or define a symbol, say %, such that a%b = (a...

6 months ago | 1 answer | 0

Question

Phasor representation of complex numbers

Instead of typing (3+4i)*(i), how can I multiply two complex numbers in phasor form, in this case (5∠(arctan(4/3))*(∠90), and ...

6 months ago | 1 answer | 0

Question

Changing where divisions appear on a Matlab plot

The following code generates a plot in which the scale divisions appear at the edges of the plot but they do not coincide with t...

7 months ago | 1 answer | 0

Question

Improving readability of Matlab graph

The plot generated by the following code appears with the ticks labelled 1 to 25 for the x axis and 0 to 20 for the y axis. I wa...

7 months ago | 2 answers | 0

Question

Unexpected output when trying to plot the solution to a system of nonlinear differential equations

The following Matlab code is meant to plot x(1) vs time and x(2) vs time separately, but only plots x(1) vs time. Despite there ...

7 months ago | 1 answer | 0

Question

Plotting the solution to a system of second order differential equations

I am having difficulty interpreting the plots generated by the following code. Is there a way I can generate a single plot inste...

7 months ago | 1 answer | 0

Question

Plotting angular position versus horizontal position of a composite body and labeling specific points

I am trying to graph the solution to a system of differential equations. The following code graphs four functions, but they are ...

7 months ago | 0 answers | 0

Question

Adding a redundant equation to a system of algebraic equation that generates inconsistent output

In a dynamics problem I am working on, two different systems of equation that describe the motion of a body are both correct and...

7 months ago | 0 answers | 0

Question

Simplified solution to system of algebraic equations

The following code solves the system of equations for x, but the solution could be further simplified, for example, by factoring...

7 months ago | 1 answer | 0

Question

Symbolic solution to a system of algebraic equations

I get an error message stating "Reference to non existent field b" when I try to solve for b in the following system of algebrai...

7 months ago | 1 answer | 0