cannot call or index into a temporary array

Hi, I am receiving an error "cannot call or index into a temporary array" for [Ro=c(1)(1)] and [Ri=c(2)(1)]. I have tried rewriting it as [Ro=cell(1){1}] but it does't change anything. Any advice on how to fix this error ?
%-- -- code -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
function mainprogram()
clc;
clear
formal long
fid=fopen('referencerawdata.txt','rt');
c=textscan(fid,'%f%f%f',1);
Ro=c(1)(1); %column 1 row 1 of 'referencerawdata.txt'
Ri=c(2)(1); %column 2 row 1 of 'referencerawdata.txt'
theta0=c(3)(1);

回答 (1 件)

Sean de Wolski
Sean de Wolski 2014 年 3 月 10 日

0 投票

MATLAB does not support cascaded indexing.
What are you trying to do? What is the structure of c, I.e. the ouput from
whos c

2 件のコメント

Michelle
Michelle 2014 年 3 月 10 日
I am trying to call values of Ro and Ri from a .txt file structured as a table.
Sean de Wolski
Sean de Wolski 2014 年 3 月 10 日
Use the "Import Tool" to interactively import the file. Then generate a script or a function from this automatically so you can reproduce what was done interactively.

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

カテゴリ

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

タグ

質問済み:

2014 年 3 月 10 日

コメント済み:

2014 年 3 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by