Answered

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

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

20 Tage ago | 0

Answered

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

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

fast 2 Jahre ago | 0

Answered

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

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

fast 2 Jahre ago | 0

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

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

fast 2 Jahre 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...

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

fast 2 Jahre 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. ...

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

etwa 2 Jahre 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...

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

mehr als 2 Jahre 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...

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

mehr als 2 Jahre 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 ...

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

mehr als 2 Jahre 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...

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

mehr als 2 Jahre 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...

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

mehr als 2 Jahre 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...

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

mehr als 2 Jahre 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...

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

mehr als 2 Jahre ago | 2

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

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

mehr als 2 Jahre 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...

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

mehr als 2 Jahre 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...

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

mehr als 2 Jahre 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...

fast 3 Jahre 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...

fast 3 Jahre 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...

fast 3 Jahre ago

Solved

Produce a sine wave

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

fast 3 Jahre 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...

fast 3 Jahre ago

Solved

Produce a cosine wave

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

fast 3 Jahre 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...

fast 3 Jahre 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...

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

fast 3 Jahre 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...

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

fast 3 Jahre 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 ...

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

fast 3 Jahre ago | 2

| accepted

Answered

What is the possible code that can be used to return to primary while?

Use 'break'

What is the possible code that can be used to return to primary while?

Use 'break'

fast 3 Jahre ago | 0

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

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

fast 3 Jahre 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....

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

etwa 3 Jahre ago | 0