I don't understand this error in Matlab 2021a: Error using slice (line 65) V must be a 3-D array.
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Fraser Eadie
el 14 de Oct. de 2021
Comentada: Fraser Eadie
el 15 de Oct. de 2021
I'm trying to simulate photon interaction on a Z-layered slab, my code is below:
cfg.shapes=('{"Shapes":[{"Grid":{"Tag":1,"Size":[60,60,60]}},{"ZLayers":[[1,5,2],[5,10,3],[10,20,4]]}');
cfg.prop=[0.0000, 0.0000, 1.0000, 1;
3.5640, 1.0000, 1.0000, 1.3700;
18.0543, 9.3985, 0.9000, 1.3700;
1.4000, 30.0000, 0.9000, 1.3700];
cfg.tstart=0;
cfg.tend=5e-9;
cfg.tstep=5e-10;
figure
% a pencil beam outside the volume
cfg.srctype='pencil';
cfg.srcpos=[30 30 -10];
flux=mcxlab(cfg);
fcw=flux.data*cfg.tstep;
hs=slice(log10(abs(double(fcw))),[],25,1);
Any help would be great thanks.
0 comentarios
Respuesta aceptada
Voss
el 14 de Oct. de 2021
This error happens because fcw is not a 3-D array. You should inspect flux.data to see if it's what you expect.
Más respuestas (0)
Ver también
Categorías
Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!