フィルターのクリア

How to define an array with fractional index number in MATLAB?

7 ビュー (過去 30 日間)
Udit Srivastava
Udit Srivastava 2016 年 12 月 14 日
回答済み: Adam 2016 年 12 月 14 日
How to define an array with fractional index number in MATLAB?
  5 件のコメント
José-Luis
José-Luis 2016 年 12 月 14 日
My thought exactly.
Use a function of two variables.
Udit Srivastava
Udit Srivastava 2016 年 12 月 14 日
basically, i have to define an array with fractional index like p(r(i),z(j))

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

回答 (2 件)

KSSV
KSSV 2016 年 12 月 14 日
編集済み: KSSV 2016 年 12 月 14 日
You cannot define fractional indices in any software.......fortran, c takes from 0 to n...where as matlab takes from 1 to n. May be you want to call a fractional array; you have to follow like this.
x = rand(10,1) ;
n = length(x) ;
for i = 1:n
x(i)
end

Adam
Adam 2016 年 12 月 14 日
'have to' for what purpose?
Use
doc containers.Map
if you want to set up a finite lookup table of results to index into without using integer lookups.
But if your code is sufficiently fast then a function works fine and recalculate whatever is asked for.

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by