Home  
Site Partners: SpotterGuides Veloce Books  
Related Sites: Your Link Here  

Go Back   TenTenths Motorsport Forum > Racing Talk > Racing Technology

Reply
 
Thread Tools Display Modes
Old 11 Dec 2006, 15:14 (Ref:1788060)   #1
Smokey 6 litre
Veteran
 
Smokey 6 litre's Avatar
 
Join Date: Jan 2003
England
The Total Perspective Vortex
Posts: 1,707
Smokey 6 litre should be qualifying in the top 10 on the grid
Anyone use Matlab?

I'm not expecting a huge responce from this thread but i was wondering if anyone out there is familiar with the use of the MatLab software?
I need to use it for some coursework and i'm particuarly stuck on ONE question! So please if anyone is an ace at this could you help me, please...
Smokey 6 litre is offline  
__________________
"If there's anything more important than my ego around, I want it caught and shot now"
Douglas Adams. 1952-2001
Quote
Old 11 Dec 2006, 18:47 (Ref:1788214)   #2
Tony_Simpson
Veteran
 
Tony_Simpson's Avatar
 
Join Date: Oct 2001
Location:
Uxbridge
Posts: 544
Tony_Simpson should be qualifying in the top 10 on the grid
i do use MATLAB, but only small parts of it.

what seems to be the problem??
Tony_Simpson is offline  
Quote
Old 12 Dec 2006, 05:51 (Ref:1788635)   #3
avsfan733
Veteran
 
avsfan733's Avatar
 
Join Date: Oct 2002
Location:
Rochester
Posts: 1,618
avsfan733 should be qualifying in the top 10 on the grid
shot my man...i would honestly try the help menu though it is quite simply amazing
avsfan733 is offline  
__________________
I refuse to let fact get in the way of my opinion
Quote
Old 12 Dec 2006, 07:42 (Ref:1788681)   #4
ubrben
Veteran
 
Join Date: Jun 2005
United Kingdom
Birmingham
Posts: 508
ubrben has a lot of promise if they can keep it on the circuit!
Go ahead, I'm a fairly heavy Matlab user.

BTW, have you tried the forums at matlabcentral.com?

Ben
ubrben is offline  
Quote
Old 12 Dec 2006, 20:08 (Ref:1789224)   #5
imull
Veteran
 
Join Date: Nov 2001
Location:
Isle of Mull.
Posts: 601
imull has a lot of promise if they can keep it on the circuit!
just came out in a cold sweat and started shaking. god I hated using that program at uni cracking bit of kit though!

Matlab central and the help menu as the others have said. both brilliant resourses...
imull is offline  
__________________
I love the deadlines. Especially the sound of them screaming by...
Quote
Old 12 Dec 2006, 21:31 (Ref:1789304)   #6
The STIG
Veteran
 
The STIG's Avatar
 
Join Date: Oct 2005
United Kingdom
Too far from home
Posts: 2,197
The STIG should be qualifying in the top 10 on the grid
Do not mention Matlab in my presense, got to use it for Uni Coursework and I don't like it at all!

Because I can't get the dammed thing to work, that's why!
The STIG is offline  
__________________
Live Life in Overdrive.
Quote
Old 12 Dec 2006, 21:45 (Ref:1789318)   #7
ubrben
Veteran
 
Join Date: Jun 2005
United Kingdom
Birmingham
Posts: 508
ubrben has a lot of promise if they can keep it on the circuit!
Quote:
Originally Posted by The STIG
Do not mention Matlab in my presense, got to use it for Uni Coursework and I don't like it at all!

Because I can't get the dammed thing to work, that's why!
It's incredibly powerful and much easier than programming languages like C++.

What won't it do?

Ben
ubrben is offline  
Quote
Old 12 Dec 2006, 21:47 (Ref:1789320)   #8
The STIG
Veteran
 
The STIG's Avatar
 
Join Date: Oct 2005
United Kingdom
Too far from home
Posts: 2,197
The STIG should be qualifying in the top 10 on the grid
Quote:
Originally Posted by ubrben
It's incredibly powerful and much easier than programming languages like C++.

What won't it do?

Ben
uh... anything I want it too!
The STIG is offline  
__________________
Live Life in Overdrive.
Quote
Old 12 Dec 2006, 23:58 (Ref:1789402)   #9
Tony_Simpson
Veteran
 
Tony_Simpson's Avatar
 
Join Date: Oct 2001
Location:
Uxbridge
Posts: 544
Tony_Simpson should be qualifying in the top 10 on the grid
Quote:
Originally Posted by The STIG
uh... anything I want it too!
Your telling it the wrong things then!!!!
Tony_Simpson is offline  
Quote
Old 13 Dec 2006, 04:11 (Ref:1789522)   #10
SteveT
Rookie
 
Join Date: Jul 2005
United States
Rockville, MD USA
Posts: 42
SteveT should be qualifying in the top 10 on the grid
Well what's your question. Matlab is an excellent programming environment.
SteveT is offline  
Quote
Old 13 Dec 2006, 08:37 (Ref:1789624)   #11
ubrben
Veteran
 
Join Date: Jun 2005
United Kingdom
Birmingham
Posts: 508
ubrben has a lot of promise if they can keep it on the circuit!
Quote:
Originally Posted by The STIG
uh... anything I want it too!
What do you want it to do, and what did you try?

The "getting started" help is very good, so if you can't get it to do anything I'd be surprised and/or worried.

Ben
ubrben is offline  
Quote
Old 13 Dec 2006, 13:10 (Ref:1789832)   #12
Smokey 6 litre
Veteran
 
Smokey 6 litre's Avatar
 
Join Date: Jan 2003
England
The Total Perspective Vortex
Posts: 1,707
Smokey 6 litre should be qualifying in the top 10 on the grid
I'm quite supprised, i didn't know that the programe was widely used, thats why in my original post i said i didn't expect many replies.

I have 1 question to do for a piece of coursework, i've done all the rest but this is the sticking point.

7. Plot the two graphs y=3e-x and y=2sinx on the same plot. Use different colours and line-styles. Choose your own scales on the axes. Add a title to the graph and annotate to indicate which graph is which.

i got to this...

>> plot(((3*(2.71828183^-x))'c--'), [-6,2])
>> hold on
>> plot((2*sin*x,'r-'), [-6,2])
>> xlabel('x-axis')
>> ylabel('y-axis')
>> title(['Plot of y=3*e^-x and y=2*sin*x'])
>> text(150,19,'\it{y=3*e^-x}')
>> text(150,21,'\it{y=2*sin*x}')

and am now truly stuck as matlab wont accept it (it will accept parts of it). I am doubtful that anyone who doesn't use matlab regularly could help but if you could i'll be very grateful.
Smokey 6 litre is offline  
__________________
"If there's anything more important than my ego around, I want it caught and shot now"
Douglas Adams. 1952-2001
Quote
Old 13 Dec 2006, 14:30 (Ref:1789898)   #13
rcarr
Veteran
 
rcarr's Avatar
 
Join Date: Nov 2005
Germany
Back to the homeland of Scotland!
Posts: 952
rcarr has a lot of promise if they can keep it on the circuit!
My friend who works for a DTM/FIA GT team swears by Matlab.
It is used in industry.
rcarr is offline  
__________________
These comments are my personal opinion, they do not reflect the views of others at Carr Racing. Born into racing! Will never leave racing, ever! Its in my blood!
Quote
Old 13 Dec 2006, 14:43 (Ref:1789904)   #14
Smokey 6 litre
Veteran
 
Smokey 6 litre's Avatar
 
Join Date: Jan 2003
England
The Total Perspective Vortex
Posts: 1,707
Smokey 6 litre should be qualifying in the top 10 on the grid
Good to know that i am not strugling with it for nothing then.
Smokey 6 litre is offline  
__________________
"If there's anything more important than my ego around, I want it caught and shot now"
Douglas Adams. 1952-2001
Quote
Old 13 Dec 2006, 15:11 (Ref:1789914)   #15
ubrben
Veteran
 
Join Date: Jun 2005
United Kingdom
Birmingham
Posts: 508
ubrben has a lot of promise if they can keep it on the circuit!
Quote:
Originally Posted by Smokey 6 litre
I'm quite supprised, i didn't know that the programe was widely used, thats why in my original post i said i didn't expect many replies.

I have 1 question to do for a piece of coursework, i've done all the rest but this is the sticking point.

7. Plot the two graphs y=3e-x and y=2sinx on the same plot. Use different colours and line-styles. Choose your own scales on the axes. Add a title to the graph and annotate to indicate which graph is which.

i got to this...

>> plot(((3*(2.71828183^-x))'c--'), [-6,2])
>> hold on
>> plot((2*sin*x,'r-'), [-6,2])
>> xlabel('x-axis')
>> ylabel('y-axis')
>> title(['Plot of y=3*e^-x and y=2*sin*x'])
>> text(150,19,'\it{y=3*e^-x}')
>> text(150,21,'\it{y=2*sin*x}')

and am now truly stuck as matlab wont accept it (it will accept parts of it). I am doubtful that anyone who doesn't use matlab regularly could help but if you could i'll be very grateful.
You clearly haven't read the slightest thing about how Matlab works. Open Matlab and press F1 and go to "Getting Started with Matlab" in the help and read it.

Despite the fact that you have a homework assignment you haven't prepared for, I'll help you because Matlab is one of the most useful things you can learn if you want to work in Aerospace or Motorsport. PI V6 exports data directly in Matlab .MAT format - it does this for a reason.

Right, now what have you done wrong?

You haven't defined x. Matlab isn't normally symbolic (it has a symbolic tool box but you don't need it for what you're doing)

To calculate the two equations you need:

x = [0:0.1:10]

This creates an array of x numbers you can operate on from 0 to 10 in 0.1 increments. You didn't specify the range you needed, adjust accordingly and search the help for defining arrays.

Then you need;

y = 3.*(exp(-x));

and

y2 = 2.*(sin(x));

The . before the * sign means you are doing array multiplication not a matrix calc. You multiplying by one number so it doesn't matter, but it's good to understand the difference. Read the help.

The semi-colon supresses the output so you don't fill the command window with numbers.

Ok you now want to plot your two functions:

plot(x,y,x,y2)

You then need to lable the graph:

legend('y = 3e^-^x','y = 2sinx' )

The ^ make the following character superscript. Type help legend in the command prompt for help.

You then need a title and x and y labels. I'll let you find the help for those.

Ben
ubrben is offline  
Quote
Old 13 Dec 2006, 15:14 (Ref:1789916)   #16
William Dale Jr
Veteran
 
William Dale Jr's Avatar
 
Join Date: Mar 2002
Australia
Townsville, North Queensland
Posts: 1,225
William Dale Jr should be qualifying in the top 10 on the grid
I did a subject on using Matlab in first year, but that was a while ago now. It still pops up every now and then, and it's probably come up more and more in the next couple of years of my degree.

I hate it because I don't know how to use it properly, but I'm getting better

Anyway, a couple of things come to mind:
  • In my experience, to plot something like that, you need to give matlab an array of values for x to equal. Is that what the -6 and 2 are there for? If so, you need to set it up independently before you put it into the plot function, like so:

    x = [-6:0.1:2]

    The number between the semi-colons defines the size of the steps (i.e. it'll generate a one-row matrix with the values [-6, -5.9, -5.8, ... , 1.9, 2] )
  • For the sake of clarity, define your y-equations (using variable names like y1 and y2) and then plug those variables into the plot function, so your plot function just looks like:
    plot(x,y1)
    or plot(x,y2)
    or plot(x,y1,x,y2) if you want to be tricky and plot them both using the same function instead of using 'hold on'.
  • Have a look under plot in the help section of the program to show you how to label stuff and change axis names; it'll tell you more than I ever could!

Hope I've pointed you in the right direction, but there's every chance that I haven't. F****** Matlab!


EDIT: Just follow Ben's explanation. It's better than mine!
William Dale Jr is offline  
__________________
"Our traction control was kinda how much your last crash was still hurting you." - Kevin Schwantz
Quote
Old 13 Dec 2006, 17:14 (Ref:1789967)   #17
Smokey 6 litre
Veteran
 
Smokey 6 litre's Avatar
 
Join Date: Jan 2003
England
The Total Perspective Vortex
Posts: 1,707
Smokey 6 litre should be qualifying in the top 10 on the grid

Right i have now sucessful completed by Matlab assignment and a big thank you to everyone who has posted coments here, and especially BIG THANKS go out to Ubrben and William Dale Jr.

Well done boys, now that i've done it its obvious where i was going wrong, stupid stuff really.

THANK YOU
Smokey 6 litre is offline  
__________________
"If there's anything more important than my ego around, I want it caught and shot now"
Douglas Adams. 1952-2001
Quote
Old 14 Dec 2006, 06:20 (Ref:1790300)   #18
avsfan733
Veteran
 
avsfan733's Avatar
 
Join Date: Oct 2002
Location:
Rochester
Posts: 1,618
avsfan733 should be qualifying in the top 10 on the grid
From personal experience...I don't bother coding in x and y labels...I have found it much easier to use the axis edit tool which will save the data you put in.

as ubrben said...the help menu is like mecca. There is very little matlab can't do. I utilized it last semester to basically hand code a finite difference program for a heat transfer project. if you have questions find the help and read it. it almost always has examples which are usually very helpful.
avsfan733 is offline  
__________________
I refuse to let fact get in the way of my opinion
Quote
Old 14 Dec 2006, 07:43 (Ref:1790346)   #19
ubrben
Veteran
 
Join Date: Jun 2005
United Kingdom
Birmingham
Posts: 508
ubrben has a lot of promise if they can keep it on the circuit!
Quote:
Originally Posted by avsfan733
From personal experience...I don't bother coding in x and y labels...I have found it much easier to use the axis edit tool which will save the data you put in.

as ubrben said...the help menu is like mecca. There is very little matlab can't do. I utilized it last semester to basically hand code a finite difference program for a heat transfer project. if you have questions find the help and read it. it almost always has examples which are usually very helpful.
I don't tend to hard code labels either... unless I'm processing a large number of input files of test data that have naming conventions that tell me something about the test condition. In this case you can loop plot generation and automatically create all the plots as you want.

Ben
ubrben is offline  
Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 17:17.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Original Website Copyright © 1998-2003 Craig Antil. All Rights Reserved.
Ten-Tenths Motorsport Forums Copyright © 2004-2021 Royalridge Computing. All Rights Reserved.
Ten-Tenths Motorsport Forums Copyright © 2021-2022 Grant MacDonald. All Rights Reserved.