Getting error "Subscript indices must either be real positive integers or logical'

1 回表示 (過去 30 日間)
I am getting this error when I run the following commands. Help needed at the earliest.
v=[1 -2 3];
n=norm(v);
  1 件のコメント
Stephan
Stephan 2019 年 1 月 2 日
Works for me in R2018a:
>> v=[1 -2 3]
v =
1 -2 3
>> n=norm(v)
n =
3.7417

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

採用された回答

madhan ravi
madhan ravi 2019 年 1 月 2 日
編集済み: madhan ravi 2019 年 1 月 2 日
It might happen that you have a variable called norm so try the below:
clear all
% or
clear norm
% or
clear norm global
v=[1 -2 3];
n=norm(v);
Also
which norm -all % what shows up
  2 件のコメント
Sania Gul
Sania Gul 2019 年 1 月 4 日
Thank u so much, u r right
madhan ravi
madhan ravi 2019 年 1 月 4 日
Anytime :)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by