Posted by : Unknown Tuesday, October 8, 2013

In this post i show you how to create M-File In MATLAB.

  1. Run MATLAB on your Computer. There's various method to create M-file in MATLAB.
  2. In old version there's option of "FILE" , Go to file and create "New M-file". But in new version there's an option of creating "New Script".

ctrl+N" to create a new M file.
3. Or In short you press "
4. An editor will open like taht in figure.

5.Now write your code here.
e.g.
Implement the factorial using functions and loop
functions fact= factorial(num)
for i=num : -1 : 1
fact= fact*i
end;
end

6. One thing is most important the function name must be the same to the M-file name.
7. Now in command window call your function like that.
"factorial(5) "

8. I hope this is helpful for you....

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Let's Join Us

This blog is for Computer Programming Learner or who is interested in to learn different programming languages

Get Toolbar Free

Get our toolbar!

FeedBurner FeedCount

Computer Problems

Total Pageviews

Popular Post

Labels

About Us

I am a student Of computer Engineering , Studying at UET Taxila. Web development and Programming is my passion. http://about.me/umair.tariq

Top Commentators

Followers

Powered by Blogger.

Recent comments

- Copyright © Computer Problems -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -