Jump to content

Matlab


5614

Recommended Posts

I have no experience of using MATLAB but I would like to learn it (part time) in 6 weeks, probaby to a respectable standard, for something I'm doing over the summer.

 

I am keen to learn how to use it but is this a realistic aim in 6 weeks? I will have to teach myself.

 

Can anyone advise/comment on this?

 

Are there any books which are good and assume no previous knowledge?

 

(I need to make a decision in the next day or so)

Link to comment
Share on other sites

I'm very good at Visual Basic... but never used BASIC. I do understand there are great differences in the two though. Also from what I've read BASIC doesn't sound too hard, correct me if I'm wrong.

 

How did you learn it in 3 weeks? Were you given lessons or a book or online tutorial? As I'm teaching this to myself I will either have to find/buy a book unless there's some good tutorials on the Internet.

Link to comment
Share on other sites

it was a sort of crappy booklet thing that didn't really explain things too well but

it got the basics across and you can use the help to get the more advanced things. as for the three week thing, i missed the first 4 weeks of class(nobody informed me as to where the class actually was and the directory sucks ass and didn't list the class) so i stayed up late trying to get it right. its not too difficult

Link to comment
Share on other sites

I told you; because it was urgent. I need to make a decision quickly and I respect you and know you are very knowledgeable in your subject, so I hoped you could help. Sorry if it bothered you. (Like I said in the PM, I wouldn't normally do that)

Link to comment
Share on other sites

I want to learn it too. I have access to the book "Mastering MATLAB", it's a decent book, but the help and demos on MATLAB are very well done and for now it was enough for me.

Link to comment
Share on other sites

OK, so got two questions at the moment regarding the use of MATLAB.

 

Firstly:

n=4
x = -n:1:n
y=x.^2
plot(x,y)

is a correct code for plotting x vs. x² however my question is why do you need the dot in the line:

y=x.^2

what is the purpose of that dot? Why can you not just say: y=x^2 ?

 

Secondly:

x=[0:0.1:pi]'
y=x'
z=sin(x*y)
mesh(x,y,z)

will plot a nice 3D graph of f(x)=sin(x) I've noticed that you must include the dash ' at the end of the first two lines, from experimenting this seems to mean that x and y are processed as columns and not rows. Is this the reason for having the dash and if so how do you know when you need a dash (e.g. for x and y) and when you do not (e.g. for z)

 

Thanks again for the help.

Link to comment
Share on other sites

OK' date=' so got two questions at the moment regarding the use of MATLAB.

 

Firstly:

n=4
x = -n:1:n
y=x.^2
plot(x,y)

is a correct code for plotting x vs. x² however my question is why do you need the dot in the line:

y=x.^2

what is the purpose of that dot? Why can you not just say: y=x^2 ?[/quote']It does the squaring elementwise - this is important with bigger matrices, ie. you may want to multiply each row of a nxn matrix by a scalar stroed in a nx1 matrix using the '.'

Secondly:

x=[0:0.1:pi]'
y=x'
z=sin(x*y)
mesh(x,y,z)

will plot a nice 3D graph of f(x)=sin(x) I've noticed that you must include the dash ' at the end of the first two lines, from experimenting this seems to mean that x and y are processed as columns and not rows. Is this the reason for having the dash and if so how do you know when you need a dash (e.g. for x and y) and when you do not (e.g. for z)

 

Thanks again for the help.

Yeah - the dash transposes the matrix.

 

In your example, the dash means that the dimensions of the multiplication are correct, eg. in your example this ensures that z is a matrix of size 32x32

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.