Storing Arrays in a Matrix
Mostrar comentarios más antiguos
Hi, I'm currently trying to make a function that outputs an array containing all the different arrays for a stage of separations:
function stage_out = calc_stage(frac, ratio, Pin, Pout, perm, flux, total)
stage_k = calc_K(frac, flux, Pin, Pout);
stage_rej = calc_rej(frac, ratio, stage_k);
stage_perm = calc_perm(stage_rej, stage_k);
flow_perm = total*ratio;
flow_rej = total-flow_perm;
stage_perm_flow = stage_perm*flow_perm;
stage_rej_flow = stage_rej*flow_rej;
stage_out = [stage_k; stage_rej; stage_perm; stage_rej_flow; stage_perm_flow];
end
Stage_k ... etc are all 5x1 arrays, however when I call this function it outputs a single column array with a mixture of numbers in it. Coming over from Python, I'm not quite sure how this would work. How would I get this code to work as intended?
Thanks,
Edo
Edit: I fixed this issue, obviously changing the semicolons to colons helped. I was also using the wrong variable somewhere so this was also causing issues! Sorry for the bother.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Call Python from MATLAB en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!