提问


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

7 years 前 | 1 个回答 | 1

1

个回答

已回答
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 ...

7 years 前 | 0

| 已接受

已回答
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...

7 years 前 | 1

已回答
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.

7 years 前 | 0

已回答
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...

7 years 前 | 2

| 已接受

已回答
"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...

7 years 前 | 0

已回答
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...

7 years 前 | 0

| 已接受

已回答
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,...

7 years 前 | 0

已回答
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...

7 years 前 | 0

| 已接受

已回答
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. ...

7 years 前 | 1

| 已接受

已回答
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...

7 years 前 | 0

已回答
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...

7 years 前 | 0

| 已接受

已回答
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...

7 years 前 | 0

| 已接受

已回答
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...

7 years 前 | 0

已回答
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...

7 years 前 | 0

已回答
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.

7 years 前 | 0

已回答
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

7 years 前 | 0

已回答
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" ...

7 years 前 | 0

已回答
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 ...

7 years 前 | 0

已回答
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....

7 years 前 | 1

已回答
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.

7 years 前 | 0

已回答
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...

7 years 前 | 1

已回答
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...

7 years 前 | 0

已回答
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 前 | 1

| 已接受

已回答
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 前 | 2

| 已接受

已回答
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 前 | 0

已回答
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 前 | 0

| 已接受

已回答
[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 前 | 1

已回答
[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 前 | 0