Answered
Slope of a curve
Slope is the change in the y value divided by the change in the x value. When dealing with numerical calculations, there are a ...

8 years ago | 3

| accepted

Question


Why use an "if" statement to encapsulate a block of code?
I notice that many users encapsulate their code inside an if statement such as if true ... (code) ... end What...

8 years ago | 1 answer | 1

1

answer

Answered
Euler's Method for stiff ODE
Torsten is right. There is no way you will get a solution with a large step size (h=5). I checked out your code and it works ...

8 years ago | 0

| accepted

Answered
How to create a counter variable in a loop
What you are describing sounds like a histogram. You can use the function "histcounts" to count the number of times a number ap...

8 years ago | 1

Answered
Hi, I am new to MATLAB. I am not getting the plot .
Inside the abs function you are dividing two vectors. This is where the error is.

8 years ago | 0

Answered
help please why ??
the statement sum(A(1)) is summing only the first element in A, which is 1. If you want to sum the first row, it shoul...

8 years ago | 2

| accepted

Answered
"Model based development and testing using PLC coder"
Model Based: Any endeavor that is "Model Based" places an emphasis on the use of simulation models. "Model Based Developm...

8 years ago | 0

Answered
Divide vector of coordinates into even intervals.
Based on your description of the problem, this is what I would do: Given a vector of lat/lon positions which represents one r...

8 years ago | 0

| accepted

Answered
Newbie question - Error in line 2
Your equation set looks like it produces a direction cosine matrix for a planar rotation about the Z axis. If this is the case,...

8 years ago | 0

Answered
How would I improve my euler code?
For trapezoidal integration, you use the average of two consecutive evaluations. This could be done by simply adding one line of...

8 years ago | 0

| accepted

Answered
convert wind direction in true North to Math convention
Working with wind direction vectors can be confusing, because there are two different conventions which are both widely used. ...

8 years ago | 1

| accepted

Answered
MATLAB -- how to create a parabolic arc?
This is a simple polynomial curve fit problem. If you have the curve fitting toolbox, the problem is solved by: x = [0 5 10...

8 years ago | 0

Answered
Centering Multiple circular images
Here is a thought. The images appear to have some significant circular waves emanating from the (presumed) center. I would u...

8 years ago | 0

| accepted

Answered
Measure depth tread of the tire?
I can't imagine how you will get tread depth from this photo. Wouldn't you rather have a photo of the profile, similar to the a...

8 years ago | 0

| accepted

Answered
Merge block connection issue
Look at help for the merge block. Merge is intended for use with conditionally executed blocks where only one of the blocks i...

8 years ago | 0

Answered
How do I create a for loop to separate each oscillation on a plot to take the average of each section.
Here is a suggestion for an algorithm: Your data looks like it settles down very well in between events, so I would use a sli...

8 years ago | 0

Answered
How to find the nth derivative of square root of a polynomial using forward or backward differences. f(x)=sqrt(a0+a1 x + a2 x^2+a3 x^3+...an x^n)
See the attachment for numerical derivative formulas from my collection.

8 years ago | 0

Answered
what do the variable P,I and D mean in PID(z) in simulink?
See the link to help in Guillaume's comment: Proportional Integral Differential

8 years ago | 0

Answered
Generate a 4-Hz, 1000-point sine wave with a sample interval of T=0.002, and use quantiziation to digitize it using a 4-,8-,12-, and 16-bit ADC...
The first thing I notice is that signal_in is computed from signal_in = sin(2*pi*frequency*t) but variable "frequency" ...

8 years ago | 0

Answered
Simulink: Buffer with constant input due to delay of input
The default sample time for a constant block is "inf". Based on the error message, the first thing I would check is the sample ...

8 years ago | 0

Answered
How can i make my MATLAB code to run faster or robust while having many function calls and for loop up to thousands?
There is one blanket method which will speed up any Matlab code - use the Matlab compiler to generate an executable (.exe) file....

8 years ago | 1

Answered
Why is an empty string not empty? isempty('') returns true, but isempty("") returns false
As near as I can tell, Matlab does not use the double quote character, so isempty("") is not a valid statement.

8 years ago | 0

Answered
Please , how can I find the center and the radius of the inscribed circle of a set of points
I have worked this problem in the past, and the only solution I could find was a numerical searching method. There are a number...

8 years ago | 1

Answered
How can I create semicircle signal in Simulink?
I would use the MATLAB Function block with the code in the PDF file attachment. (Found a typo in the first attachment. Pleas...

8 years ago | 0

Answered
discrete simulink model problem
Although I am unable to open and view your model, a very common problem when converting from continuous to discrete is that the ...

8 years ago | 1

| accepted

Answered
Matlab function in Simulink - calling variable from workspace
Try declaring the variables to be persistent at the top of the function, i.e. persistent prev_angle prev_counter

8 years ago | 2

| accepted

Answered
How to get a sin function in simulink
I'm a little confused by the problem statement. Inside the sine function you have x/2000 * t. I'm not sure which represents th...

8 years ago | 0

Answered
Find coordinates point M
See attachment. The symbolic solution will be very messy and require quite a lot of algebra. If you have the symbolic math t...

8 years ago | 0

| accepted

Answered
[EMERGENCY NEED CRITICAL HELP] Numerically determine the Voltage
You are given an equation for i(t). All you need to do is integrate it directly, but your instructions are to perform the integ...

8 years ago | 1

Answered
[PLEASE HELP] Derive the time and distance values...
After looking at your table, it is clear that you are given a time history of velocity and acceleration samples and you wish to ...

8 years ago | 0