MATLAB Getting Started with MATLAB Simulations of Basic Equations

AI Thread Summary
The discussion centers around a user new to MATLAB seeking assistance with simulating an equation related to arterial pressure. The equation provided is "Arterial pressure = Mean arterial pressure - h*7.46," where height (h) is the independent variable. Participants suggest starting with basic plotting examples to understand how to visualize the relationship between h and arterial pressure. They explain how to define h as a variable and plot the results using MATLAB's plotting functions. The user also inquires about implementing the same simulation in Simulink and how to import the variable h, indicating a need for guidance on using specific blocks in Simulink. Additionally, there is a mention of another user seeking help with finding coordinates in a MATLAB plot, highlighting ongoing queries about MATLAB functionalities.
mit_cool
Messages
20
Reaction score
1
Hello friends,
I am new to MATLAB and I have been asigned a task in MATLAB to simulate basic equation..
I have no idea how to start..
The equation is

Arterial pressure= Mean arterial pressure - h*7.46 (h= height)

Can you tell me how to do please?

thankx
 
Physics news on Phys.org
what are you trying to do? plot it?

if so here's an example to try first:

a=3
b=5
x = [ 1, 2, 3, 4, 5 ]
y = a*x + b

plot(x,y)

y2=x*x
plot(x,y2)

...
 
but how can i relate this to my equation?
yes..I have to plot it ..H is variable and Arterial pressure is output
 
so h is the independent variable just like the x in my example where I set
x = [ 1, 2, 3, 4, 5]

there is also a way to set x via a range:
x=1:5:0.1

where x will vary from 1 to 5 by 0.1 increments ie x=[1.0, 1.1, 1.2, 1.3 ... 5]

this should give you enough to solve the problem and plot your results via plot(h,ap)
 
Thank you man ..now it is clear..

I have one more question..

I am trying to do same in simulink but can you tell me how to import my variable H in simulink? i mean which block shall I use?
 
Thanks again
 
Hi am new to MATLAB...I need to find the coordinates of a figure in a plot
but i don't know how ...
kindly explain
 

Similar threads

Replies
3
Views
3K
Replies
1
Views
3K
Replies
10
Views
3K
Replies
2
Views
2K
Replies
5
Views
3K
Replies
2
Views
1K
Back
Top