Working on Binary Data using MATLAB
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
have loaded a text file test file in matlab. The load function has now created a variable test with values
1 2 3 4 5
2 3 NaN NaN NaN
Now I have a initialized variable X = [0 0 0 0 0 0 0 0 0 0 0] and Y = [0 0 0 0 0 0 0 0 0 0 0]. I want X to read the first row of test variable and corresponding to the number it reads change its value of the element from 0 to 1. Suppose it reads 1, it should change its element X(1) from 0 to 1. Similarly Y should do the same wrt second row of test.
Any idea how should I proceed?
0 Commenti
Risposte (1)
Walter Roberson
il 1 Mag 2011
X(test(1,~isnan(test(1,:)))) = 1;
Y(test(2,~isnan(test(2,:)))) = 1;
0 Commenti
Vedere anche
Categorie
Scopri di più su Standard File Formats in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!