2

I am trying to read data files each containing one column and 4097 rows. But my function needs total numbers of rows with even number (means 4096). So I used the MATLAB command x(2:length(x))). But my 'x' value in this command is a(:,k) and the issue is MATLAB cannot call or index into a temporary array. Any solution to this? I thank all for the support. The code is:

for k = 1:9
with filename = sprintf('F00%d.txt',k);
a(:,k) = load(filename);
x = a(:,k)(2:length(a(:,k)));
w = tqwt(p,1,3,3);
[a1,a2,a3,a4]= deal(w{:});

 m(a1,1) = mean(a1);
 s(a1,1) = std(a1);
 ma(a1,1) = max(a1);
 mi(a1,1) = min(a1);
1
  • Why are you posting questions, receive answers and then delete the questions? Commented Jul 1, 2017 at 6:08

1 Answer 1

3

Unfortunately, you have to split x = a(:,k)(2:length(a(:,k))); into two lines as shown below:

temp = a(:,k);
x = temp(2:length(a(:,k)));

Please read:

  1. Indexing of a function's return
  2. How can I use indexing on the output of a function?
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.