답변 있음
when a save figure , the numbers appear in the name of the png with e+0X
Change your format spec to '/Figures/Distance_%d@%.3f.png' You might want to read up on the documentation for this: https://w...

거의 6년 전 | 1

| 수락됨

답변 있음
How to get a variable value in the gain block. This variable value is defined in a Matlab function block.
To do this, I would use a Multiply block instead of a gain block. Make x an output from your Matlab function block. Connect th...

거의 6년 전 | 0

답변 있음
How to quickly find the first non-zero element without iterations in all columns in a sparse matrix?
Try this. In my test with a 1000x1000 random sparse 0 or 1 matrix (A = sparse(randi([0 1], 1000, 1000));) it is about 4 times f...

거의 6년 전 | 0

답변 있음
can some xxplain what the following program does? Thank youuuu!: peso=5000; while (peso > 0) disp (‘I order another coffee’); dollar = dollar – 250; end disp (‘I finished drinking
Per Stephens comment, I'm repeating my comment as an answer (with some additions). This script does pretty much nothing other t...

거의 6년 전 | 1

답변 있음
How can i discretize a signal within simulink?
Look at the ZOH (https://www.mathworks.com/help/simulink/slref/zeroorderhold.html) and Unit Delay (https://www.mathworks.com/hel...

대략 6년 전 | 0

답변 있음
How do I find maximum value of n so that 2^n is less than a value (ex, 500?)
I think you may be looking for log2. Documentation available here: https://www.mathworks.com/help/matlab/ref/log2.html

대략 6년 전 | 0

답변 있음
Diagonal matrix, wishing to solve Ax=b
I thought that I had commented on this question earlier with something that should work for you. Here is the code that I think ...

대략 6년 전 | 0

답변 있음
help with inefficient code
Try this. There may be a more efficient approach but I'm pretty sure this will be faster than what you have now. T1.time = [ ...

대략 6년 전 | 0

| 수락됨

답변 있음
Array indices must be positive integers or logical values.
The error text pretty much explains why you are getting an error. "Array indices must be positive integers or logical values" ...

대략 6년 전 | 2

| 수락됨

답변 있음
How can I know if my laptop is plugged into AC power via Matlab?
That error message (''pmset' is not recognized as an internal or external command, operable program or batch file) is a Windows ...

대략 6년 전 | 1

| 수락됨

답변 있음
Extracting a value from a 3D table
A 3d example using Matlab's indexing functions instead of floor and rem: t3=[1 2 NaN; 4 5 6; 7 8 9]; % a 2d matrix with one N...

6년 초과 전 | 0

답변 있음
Legend not working with plot (just have some incorrect colors)
If you make the 'for radius = r' loop the inner loop instead of the outer loop, you should get what you want. What is happeni...

대략 8년 전 | 0

답변 있음
I would like to evaluate a function for N=11,21,51,and 101 using a for loop, but I can only get it to do the last N.
You will need to use an array to store the four different df results. Since your df is going to be different sizes depending on...

대략 8년 전 | 0

답변 있음
How do I fix Invalid first data argument ?
The plot() function requires variables as arguments, not a character vector (which is what you have created by putting single qu...

대략 8년 전 | 0

| 수락됨

답변 있음
How to remove markers in plot at specified places?
If the goal is to remove all of the markers except for the 'outer' ones, then try this. This should be relatively generic (inde...

대략 8년 전 | 0

| 수락됨

답변 있음
My Function is supoosed to return 55 when i call it with 10 based off of pyramid sum. However my function gives me 20. Please help
The *main* problem with this code is that you are using the same variable for the loop index and for accumulating your result. ...

8년 초과 전 | 1

| 수락됨

답변 있음
Having Trouble with enable/delay etc in Simulink
It sounds like you just need an Integrator with your 'enable' signal as the input instead of a Ramp block. When 'enable' is one...

8년 초과 전 | 0

답변 있음
How can I display Index of a data point on the Data Cursor?
Try this (modify the num2str calls as you wish to get the number of digits you desire): function output_txt = datatip_cb15d...

8년 초과 전 | 2

답변 있음
how do you make an interpolation such that it interpolates the value betwee the first and the last array entry?
*_IF_* you are saying that the 'position = 100' value is the same as the 'position = 0' value then you can just do a modulo 100 ...

8년 초과 전 | 0

답변 있음
Matlab Function block code
Note that you can also do this with simple Simulink blocks (and no Matlab function block). If you don't have to protect against...

거의 9년 전 | 1

답변 있음
Create Lookup Table in Matlab
As Image Analyst said, I think interp1 is the way to go. However, I would just call it with the specific angle for which you wa...

거의 9년 전 | 0

답변 있음
Error in saveas, can't create png files
It looks like you may have another function or variable that is 'shadowing' the built-in print function. Try 'which -all pr...

거의 9년 전 | 0

답변 있음
Not just another dynamic variable naming question! Generating a new string and using it in a command.
A lot of what I'm going to say has already been said by far smarter people on this thread. I'm going to rephrase from a less sp...

거의 9년 전 | 2

답변 있음
s-function error
Replace mdlInitializes with mdlInitializeSizes

거의 9년 전 | 0

답변 있음
Print figure to a specific path
You need to pass a handle to the figure you wish to print. The parameter 'Ult_Stress_vs_Temp' is, I assume, maybe the title of ...

거의 9년 전 | 0

| 수락됨

답변 있음
Step is plotting backwards
This transfer function is unstable. It has a pair of complex (oscillatory) poles that are slightly in the right half plane. Thu...

거의 9년 전 | 1

답변 있음
Figure looks small and zoomed out
You have defined an image that is only 9x20 pixels. How big would you expect that to be (especially on your high resolution dis...

거의 9년 전 | 0

문제를 풀었습니다


Matrix of almost all zeros, except for main diagonal
Write a program to input an integer n and build a n-by-n matrix with the numbers 1,2,...,n on the main diagonal and zeros elsewh...

거의 9년 전

문제를 풀었습니다


Model a mass spring system
Model an ideal mass-spring system shown below where the spring is initially stretched. <<http://blogs.mathworks.com/images/se...

거의 9년 전

문제를 풀었습니다


Add offset to a signal
Produce the following signal: <<http://blogs.mathworks.com/images/seth/cody/add-offset-eqn.png>> You should see a downward...

거의 9년 전

더 보기