i have a problem with my code for error." Error using zeros Size inputs must be integers. "
Ältere Kommentare anzeigen
Error using zeros Size inputs must be integers.
Error in ConvertVoxelList2Voxel3D (line 11) voxel3D = zeros([voxels_number(2) voxels_number(1) voxels_number(3)]);
Error in Vis (line 59) [voxel3D] = ConvertVoxelList2Voxel3D(voxels_number, voxel_size, voxels_voted);
3 Kommentare
Walter Roberson
am 5 Mär. 2018
What values are you passing as the first parameter?
Masood Alam
am 5 Mär. 2018
Walter Roberson
am 5 Mär. 2018
voxels_number needs to be a vector of 3 positive integer values, not a scalar.
Antworten (1)
Jan
am 5 Mär. 2018
Use the debugger to find the problem:
- https://www.mathworks.com/help/matlab/debugging-code.html
- https://www.mathworks.com/help/matlab/matlab_prog/debugging-process-and-features.html
Either set a breakpoint in the failing line or use:
dbstop if error
Then run the code again and inspect the locally used variables:
disp(voxels_number)
disp(voxels_number - round(voxels_number))
The error message is clear: At least one of the elements is not sufficient for a dimension of an array.
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!