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

3 years ago | 0

| accepted

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

4 years ago | 0

| accepted

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

4 years ago | 1

| accepted

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

4 years ago | 0

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

4 years ago | 1

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

4 years ago | 0

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

4 years ago | 1

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

4 years ago | 0

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

4 years ago | 0

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

4 years ago | 2

Answered
s-function error
Replace mdlInitializes with mdlInitializeSizes

4 years ago | 0

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

4 years ago | 0

| accepted

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

4 years ago | 1

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

4 years ago | 0

Solved


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

4 years ago

Solved


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

4 years ago

Solved


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

4 years ago

Solved


Produce a sine wave
Produce a sine wave with amplitude 3: <<http://blogs.mathworks.com/images/seth/cody/sine-eqn.png>>

4 years ago

Solved


Add a block to a model
Produce the following signal: <<http://blogs.mathworks.com/images/seth/cody/add-block-eqn.png>> In this case, the slope of...

4 years ago

Solved


Produce a cosine wave
Produce the following signal: <<http://blogs.mathworks.com/images/seth/cody/cosine-eqn.png>>

4 years ago

Solved


Connect blocks in a model
Connect the blocks in the model to produce the following signal: <<http://blogs.mathworks.com/images/seth/cody/connect-blocks...

4 years ago

Answered
Plotting a unit step function without heaviside.
You are very close to the first half of your goal. Your line of code Ut= unitstep+unitstep2+unitstep3; should, I beli...

4 years ago | 0

Answered
[num,den]=series(n1,d1,n2,d2,n3,d3); please tell me that in this line which error??
As the documentation linked to by Star Strider indicates, series is meant to connect *_two_* models. So you will need to call t...

4 years ago | 0

| accepted

Answered
Switch depend on time
Use the Clock block for the current simulation time and a Switch block to compare the time to your desired switch time. This ...

5 years ago | 2

| accepted

Answered
uigetfile, load m-file variables into workspace
.m files are used to store Matlab code - NOT data. You can create data in your workspace by *_running_* an m file but not b...

5 years ago | 1

Answered
Cannot read properly with fscanf a file configuration.in
For your specific example, I would just change the extension of the file to .m and run it. Your example is valid Matlab m code....

5 years ago | 0

Answered
What proportion of students failed the course (i.e., got a mark of less than 50)?
How did you calculate it and why do you think that it is wrong?

5 years ago | 0

Answered
how retain value of variable in memory between calls to the function?
I think what you need is to define the variable(s) that need to be retained as 'persistent' inside your function. Check the doc...

5 years ago | 1

Answered
Range Theta from 0 to 2Pi and plot
Change the divide in your equation for reflectedPerpendic to an element-by-element divide as follows: reflectedPerpendic = ...

5 years ago | 1

| accepted

Load more