MATLAB What would be the best way to learn matlab?

  • Thread starter Thread starter DrDanger
  • Start date Start date
  • Tags Tags
    Matlab
AI Thread Summary
To effectively learn MATLAB, starting with small code examples is recommended, focusing on understanding their purpose before modifying them. Engaging with graphical outputs can enhance the learning experience. Familiarity with other programming languages like C or C++ is not necessary to begin learning MATLAB. The MATLAB documentation, particularly the "Getting Started" and "Programming Fundamentals" sections, is crucial for foundational knowledge. For robotics projects, it's advised to start with simpler tasks to build confidence. Specific questions about programming tasks, such as controlling motors and light sensors, should be directed to knowledgeable sources, including professors or peers, especially when circuit configurations and connections to MATLAB are involved. Seeking help from the professor, despite geographical distance, is encouraged for personalized guidance.
DrDanger
Messages
44
Reaction score
0
What would be the best way to learn matlab? what should I learn first? I plan on using it to program and solve physics/math problems and hopefully some other stuff. Is knowing c c++ or any other programming language necessary to learn matlab? also what are some things you use it for? thanks!
 
Physics news on Phys.org


The best way to learn a programming language is to obtain small examples (less than 20 lines of code, or so, and if you're new to programming, keep it down to just a few lines) and try making changes in them to see what happens. Be sure you well understand the purpose of the example, or playing with it will only confuse you! Its nice to pick examples that output graphics because they're more fun. No, you shouldn't learn some other language first. I've also messed around with SciLab, which is free. SciLab syntax and common library calls are a bit different from matlab.
 


Have you read the Getting Started portion of the MATLAB documentation?

- Warren
 


chroot said:
Have you read the Getting Started portion of the MATLAB documentation?

- Warren


just started. Learning about matrices right now
 


okay, so i read the getting started and took a few notes, but am still a little lost. I can graph stuff pretty good and mess around with matrices. I still can't figure out how to program or how to start. I need to write a program for a robot that will make it move and follow a line using light sensors.
 


DrDanger,

You really need to read the documentation. There's a section called "Getting Started," which you apparently have found. Below it is a section called "Programming Fundamentals."

As far as your robotics projects, you have perhaps bitten off more than you can chew.

- Warren
 


You're probably right. so where would be a good place to start? or good books to read?
 


The documentation would be a good place to start. If you have specific questions, we can help you with them.

- Warren
 


Okay thanks. I will try to be specific, but you have to understand I have been doing this for about three weeks so my vocabulary on the subject and knowledge of it is poor. Okay so here is the deal I am using a PIC processor(20 pin). I have on it two light sensors that were given to me by a professor. They are plugged into 1 pin called ra2 or ra0 can't remember. I think I am going to change this and plug them into their own pins. I guess my questions would be as follows: I know how to make it move ( i think ) but i don't know how to start it, what i mean is there are two motors each connected to a pin. in MATLAB how do i control these pins? do i give them a name or do they have one already? I read about variables, else, if, for, while, and a few other functions a little bit. In order to make it run i set both wheels to 1 right? and to make it stop i set them to 0? For the light sensors i think I am going to make it where if you shine light on one it turns right and for the other it turns left. so i guess i would use an if and say if light >20 then do this? am i on the right track?
 
Last edited:
  • #10


We have no idea how your circuit is wired up, nor how you're connecting MATLAB to your PIC, so there's no way we can be of any help. Also, why are you talking to us instead of your professor? You are paying him to answer all of your questions to your satisfaction, and it sounds like you need to ask him for an appointment to get additional help. Are you at least attending his office hours?

- Warren
 
  • #11


He is in india, and he is not my professor, he is just a professor lol if that makes any sense. I am using a thing called pickit or something like that. basically it has six prongs that connect into my circuit where there is a six pronged piece, then there are wires going from that to the chips. then i connect to my laptop via usb. I can upload pics if that will help any.
 

Similar threads

Replies
22
Views
4K
Replies
32
Views
4K
Replies
9
Views
3K
Replies
2
Views
3K
Replies
4
Views
12K
Replies
4
Views
3K
Replies
3
Views
2K
Back
Top