Asked by manel maatouk
on 18 May 2018 at 12:25

I want to browse a 4D matrix and I got this error message:

Undefined function '_colonobj' for input arguments of type 'double' and attributes 'full 4d real'.

Answer by Jan
on 19 May 2018 at 12:46

Edited by Jan
on 20 May 2018 at 14:06

The error message means, that in your code

for i=1:M

the variable `M` is a 'full 4d real' (although I do not know, what this means). Check how `M` is defined and adjust it to be a `double`. Maybe this is working already:

for i=1:double(M)

[EDITED] Walter has explained the error message: `M` is a 4D array, but the colon operator expects a scalar. Then I guess you want:

for i = 1:size(radon_cartesien, 3) for j = 1:size(radon_cartesien, 4)

Walter Roberson
on 20 May 2018 at 13:43

Jan
on 20 May 2018 at 14:02

@Walter: Thank you very much. I'm confused:

X = rand(2,3); Y = rand(2,3,4,5);

1:X % Silently uses the 1st element only, no error 1:Y % Error:

Undefined function 'colon' for input arguments of type 'double' and attributes 'full 4d real'.

After your explanation I understand the message. But if Matlab catches this problem for multi-dimensional arrays, I cannot understand, why there is no error for the 2D case. This:

for k = 1:size(X)

causes problems repeatedly and you find several concerning threads in this forum.

Walter Roberson
on 20 May 2018 at 14:22

Sign in to comment.

Opportunities for recent engineering grads.

Apply Today
## 5 Comments

## Geoff Hayes (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/401408-can-you-help-me-please-to-resolve-this-erreur-in-matlab#comment_569340

manel - please post the code that is generating this error message (the error message should indicate which line is causing the problem) because it is unclear what the

_colonobjis. What kind of object is this? How is it instantiated? What toolboxes are you using?## manel maatouk (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/401408-can-you-help-me-please-to-resolve-this-erreur-in-matlab#comment_569620

This is the code that is generating this error message

## Jan (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/401408-can-you-help-me-please-to-resolve-this-erreur-in-matlab#comment_569637

@manel maatouk: Please post code as text, such that it can be used by copy&paste to write an answer.

## manel maatouk (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/401408-can-you-help-me-please-to-resolve-this-erreur-in-matlab#comment_569821

[EDITED, Jan, code formatted]

## Jan (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/401408-can-you-help-me-please-to-resolve-this-erreur-in-matlab#comment_569860

The most important part is not posted: How is

Mdefined?You overwrite

resultatprog(s,1)in each iteration of the 2 inner loops, when the condition is met. Is this really useful?Sign in to comment.