I'm supposed to write a program that takes an equation and will accept a scalar, a vector, or matrix.
I know to use ^ when dealing with scalars, and .^ when dealing with vectors/ matrices, but is there a way that will accept both?
I hope this question is clear.
Thanks,
Emmanuel

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 2 月 9 日

0 投票

You can use .^

1 件のコメント

Emmanuel
Emmanuel 2014 年 2 月 9 日
Simple enough. Thank you very much.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by