Getting an indexing error in my matlab program. Please help.

for i=0:8
for j=0:27
N_matrix(i)(j)=0;(ERROR HERE)
end
end
()-indexing must appear last in an index expression.

1 件のコメント

KSSV
KSSV 2018 年 10 月 15 日
Indices of MATLAB start from 1

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

 採用された回答

KSSV
KSSV 2018 年 10 月 15 日

0 投票

for i=1:8
for j=1:27
N_matrix(i,j)=0;(ERROR HERE)
end
end

6 件のコメント

Virajan Verma
Virajan Verma 2018 年 10 月 15 日
Thanks again KSSV. You are brilliant man.
KSSV
KSSV 2018 年 10 月 15 日
@ Virajan Verma you can become brilliant...just read some introductory tutorials in MATLAB.
Virajan Verma
Virajan Verma 2018 年 10 月 15 日
Sure. Should i change the loop from 1 to 8 and 1 to 27??
KSSV
KSSV 2018 年 10 月 15 日
It seems you have a fortran/ C code and you are converting it to MATLAB. is it?
Virajan Verma
Virajan Verma 2018 年 10 月 15 日
Yes. I have a C code.
KSSV
KSSV 2018 年 10 月 15 日
YOu ay find it useful :<https://in.mathworks.com/matlabcentral/answers/91303-how-to-convert-a-code-from-c-language-to-matlab>

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

その他の回答 (0 件)

カテゴリ

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

タグ

質問済み:

2018 年 10 月 15 日

コメント済み:

2018 年 10 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by