Matlab program using loops

a vector is given by x=[-3.5 -5 6.2 11 0 8.1 -9 0 3 -1 3 2.5]. using conditional statements and loops, write a program that creates two vectors from x- one (call it P) that contains the positive elements of x, and a second (call it N) that contains the negative elements of x. in both P and N, the elements are in the same order as x

回答 (1 件)

Evan
Evan 2012 年 11 月 9 日
編集済み: Evan 2012 年 11 月 9 日

1 投票

If this is homework, we can't give you an exact answer, as that would defeat the purpose of your assignment and hurt the reputation of this forum. However, if you have made some progress but are stuck and can post what you have so far, I'm sure people will be willing to help you (without posting a direct solution to your assignment).

2 件のコメント

Matt Fig
Matt Fig 2012 年 11 月 9 日
編集済み: Matt Fig 2012 年 11 月 13 日
It is either homework or Sean is commanding us to "write a program that creates ..."
Evan
Evan 2012 年 11 月 9 日
You never know. Perhaps Sean is assigning us homework!

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

製品

タグ

質問済み:

2012 年 11 月 9 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by