フィルターのクリア

array in power place minus known variable

1 回表示 (過去 30 日間)
Josue Zamora
Josue Zamora 2021 年 6 月 28 日
コメント済み: Josue Zamora 2021 年 6 月 28 日
my equation is I = 12. 6^ (p - 9.5) +2 where p is an array [10: .25: 15]. not understanding why Im getting a syntax error. Is there another way to solve for I? Super new to MATLAB. Thank you.
  2 件のコメント
DGM
DGM 2021 年 6 月 28 日
編集済み: DGM 2021 年 6 月 28 日
What you posted:
I = 12. 6^ (p-9.50 +2 where p is an array [10: .25: 15)
Is obviously bad syntax with missing parentheses and mismatched brackets. I doubt this is what your actual code is.
Assuming this issue with the parentheses/brackets isn't actually your problem, paste the actual code as it's written. If you don't post the exact thing you're getting an error from, nobody can guess why.
Josue Zamora
Josue Zamora 2021 年 6 月 28 日
My apologies. Edited equation to reflect what its suppose to be.

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

回答 (1 件)

Chunru
Chunru 2021 年 6 月 28 日
Use .^ for power of an array of numbers.
p = (10: .25: 15)
p = 1×21
10.0000 10.2500 10.5000 10.7500 11.0000 11.2500 11.5000 11.7500 12.0000 12.2500 12.5000 12.7500 13.0000 13.2500 13.5000 13.7500 14.0000 14.2500 14.5000 14.7500 15.0000
I = 12.6 .^ (p-9.50 +2);
plot(p,I)
  1 件のコメント
Josue Zamora
Josue Zamora 2021 年 6 月 28 日
Ah, thank you very much!

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

Community Treasure Hunt

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

Start Hunting!

Translated by