toolbox_graph

5 views (last 30 days)
dr.rab
dr.rab on 21 Feb 2012
Answered: Leepakshi on 28 Feb 2025
when I try to use toolbox_graph to read .wrl file using read_wrl I have the error message in reshape function size arguments must be real integer the error line is reshape(face,length(face)/7)+1 because of /7 how can i fix this error? thanks

Answers (1)

Leepakshi
Leepakshi on 28 Feb 2025
Hi,
To fix the error, ensure that the length of face is a multiple of 7 before using it in the reshape function. Use integer division to avoid non-integer size arguments:
% Check if the length of 'face' is a multiple of 7
if mod(length(face), 7) ~= 0
error('The length of face is not a multiple of 7. Please check your data.');
end
% Proceed with reshaping using integer division
face_reshaped = reshape(face, [], 7) + 1;
It should resolve the issue.

Categories

Find more on Resizing and Reshaping Matrices in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!