Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Error Subscripts mismatch

Subject: Error Subscripts mismatch

From: Victoria Emberle

Date: 15 Dec, 2010 18:12:08

Message: 1 of 3

Hello,

I cannot find a way to make the variables match in size.
The code:
               
for i = 1:NumbCTImgs
    CT_ID(i,2)= CT_TagID(i).Tags.PatientID ;
end

    
size(Imgs.CT(i).Tags.PatientID) gives ans= 1 2
size(CT_ID(i,2)) gives ans = 1 1

how can I make the size of these variables match

Subject: Error Subscripts mismatch

From: Sean de

Date: 15 Dec, 2010 18:23:05

Message: 2 of 3

"Victoria Emberle" <emberley@uvic.ca> wrote in message <ieb0do$hd3$1@fred.mathworks.com>...
> Hello,
>
> I cannot find a way to make the variables match in size.
> The code:
>
> for i = 1:NumbCTImgs
> CT_ID(i,2)= CT_TagID(i).Tags.PatientID ;
> end
>
>
> size(Imgs.CT(i).Tags.PatientID) gives ans= 1 2
> size(CT_ID(i,2)) gives ans = 1 1
>
> how can I make the size of these variables match

try
size(CT_ID(i,1:2))

Subject: Error Subscripts mismatch

From: Walter Roberson

Date: 15 Dec, 2010 19:47:23

Message: 3 of 3

On 10-12-15 12:12 PM, Victoria Emberle wrote:

> I cannot find a way to make the variables match in size.
> The code:
> for i = 1:NumbCTImgs
> CT_ID(i,2)= CT_TagID(i).Tags.PatientID ; end
>
> size(Imgs.CT(i).Tags.PatientID) gives ans= 1 2
> size(CT_ID(i,2)) gives ans = 1 1
> how can I make the size of these variables match


You appear to be telling us that PatientID can be a vector of two elements (or
possibly more) rather than being restricted to being a scalar. Is that
correct? What restrictions are there on the size of PatientID? Is it variable
length or fixed size? If it is variable length you will need to either impose
a fixed maximum size or else switch to cell arrays.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us