0

I want to copy a sub range of a cell array to another one, as I do it for matrices. Here is the snippet:

T_Values_16_17{16,1:11}=T_Values{16,1:11}

It lead to error:

Expected one output from a curly brace or dot indexing expression, but there were 11 results

Doing this one by one like below is possible but I want a shortcut. What is the right syntax for this?

T_Values_16_17{16,1}=T_Values{16,1}
T_Values_16_17{16,2}=T_Values{16,2}
...
T_Values_16_17{16,11}=T_Values{16,11}

1 Answer 1

3

Here are two alternatives:

[T_Values_16_17{16,1:11}] = T_Values{16,1:11};

T_Values_16_17(16,1:11) = T_Values(16,1:11);
Sign up to request clarification or add additional context in comments.

3 Comments

I tried 2nd syntax but it does not worked as expected.
What are the input and the expected output?
@VSB You should provide a minimal example

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.