Thread Subject: beginner with matlab needs help

Subject: beginner with matlab needs help

From: Trevor Ross

Date: 22 Nov, 2009 05:34:03

Message: 1 of 3

Can anyone tell me how to find the sum of a vector using a for loop?

Subject: beginner with matlab needs help

From: Matt Fig

Date: 22 Nov, 2009 07:03:04

Message: 2 of 3

"Trevor Ross" <crazyeddie09@gmail.com> wrote in message <heaigb$nsf$1@fred.mathworks.com>...
> Can anyone tell me how to find the sum of a vector using a for loop?

Why would you want to use a For loop? Just use the sum command.

A = [1 2 3 4 5];
SUMA = sum(A)

Subject: beginner with matlab needs help

From: Jan Simon

Date: 22 Nov, 2009 11:48:08

Message: 3 of 3

Dear Trevor!

> Can anyone tell me how to find the sum of a vector using a for loop?

Do you know what a FOR loop is?
What limits should be useful for your question?
What is a vector?
How would you calculate the sum manually without Matlab?

This should be enough to solve the homework.
Jan

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
for loop Trevor Ross 22 Nov, 2009 00:39:06
rssFeed for this Thread

Contact us at files@mathworks.com