Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: select positive part of sin only
Replies: 3   Last Post: Mar 25, 2013 5:55 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
alfann

Posts: 78
Registered: 2/23/10
select positive part of sin only
Posted: Mar 24, 2013 3:19 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,
I have a small work:
1- I need to select only the positive part of the sin wave.
2- I need to keep a distance between each part of the positive wave as in this link:
http://7adab.com/upload/uploads/images/7adab2012-6d88a21ef8.png
3-How can I select the values of X-axis? for example: If I want to represent the x-axis as a thickness of a material, how can I give the program the thickness of the material to be considered as X-axis values.

Here is my code:

clc
clear all

% ----------------
% entered the values
% ----------------

a= input('The depth energy is = ');
b= input('Number of Holes is = ');

for i=1:b
t=i*0:i*0.005:i*0.5;
x=[zeros(1,20) a*sin(2*pi*t) zeros(1,20)];
plot(x);
end



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.