Julia usage in SF2526
How do I translate:
[~,I]=sort(sum(abs(Z1),1));
Answer:
I=sortperm(sum(abs.(Z1),dims=1))
(or similar)
Image processing
The internal format for representing images in Julia differs from MATLAB. Read documentation at https://juliaimages.org/latest/ Links to an external site.
When Images.js are loaded, it is possible to load images using simply
img = load("/Path/to/image")
Carefully study the typeof() the loaded values. To access red/green/blue color channel, use [color].(img), and to change underlaying format use [format].(img). It is possible to show images using simply plot(img) (assuming using Plots), but there are faster alternatives. To build an image from the separate color channels, use img = colorview(RGB, redmatrix, greenmatrix, bluematrix)
How to read a .mat file
using MAT;
B=matread("Bwedge.mat")["B"];