I'm trying to analyse some experimental in a matrix and I'm having some issues. For example I'd like to scale the columns of a matrix so that the first row of each column is 1. I'd like to do it in the neat/clean julia way that I'm now starting to learn but I'm struggling to find a good solution.
- The problem comes from the fact that each column is the result of some experimental test, and they have different lengths. I've "fixed" this by creating the matrix in excel, adding a missing in the empty cells at the bottom of the column and then copy pasting it in julia. I take this is probably not the best way to deal with the issue?
Example: (normal matrices are much bigger though)
A=[1 2 3
4 5 6
missing missing 9]
- After that, I'd like to do some analysis, one of which is scaling the matrix so that the first row is = [1 1 1...1]. I tried both map
map((x,y)->x./y,A[2:end,:],A[1,:])but it seems to apply the top row the the first N elements of the first column only. Alternatively I tried with mapslices but I'm getting the following errorMethodError: Cannot `convert` an object of type Missing to an object of type Float64
I have the feeling I'm missing something and my googlefoo is failing me... any help is much appreciated!
PS: Apologies if I missed some already answered question or if I missed some guideline, I'll try to improve my question if needed. It's the first time I post here!