How can I calculate log10(variable) ??? there is error..

5 次查看(过去 30 天)
James James
James James2021-10-17
回答: Dave B ,2021-10-17
How can I calculate log10(variable) ??? there is error..
  2 个评论
the cyclist
the cyclist 2021-10-17
Or upload variable in a mat file here, using the paperclip in the INSERT section of the toolbar.

请先登录,再进行评论。

采纳的回答

Dave B
Dave B 2021-10-17
Assuming you've defined your variable and it's numeric, this should work:
variable=100;
log10(variable)
ans = 2
x=[100 200 500 1000];
log10(x)
ans = 1×4
2.0000 2.3010 2.6990 3.0000
It may fail if you haven't defined your variable:
log10(y)
Or if your variable is not numeric:
z="100";
log10(z)

更多回答(0 个)

产品

Community Treasure Hunt

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

Start Hunting!

Translated by