Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Remove NaN and create one column

1 回表示 (過去 30 日間)
Damith
Damith 2014 年 7 月 3 日
閉鎖済み: per isakson 2014 年 7 月 4 日
3680 2420 1400 907 932 2200 4460 7110 10200 10800 7270 4890
3620 2330 1470 1050 1110 2400 4480 7250 10100 10700 7150 4780
3570 2360 1450 1200 1140 2380 4420 7340 9950 10600 7010 4700
3650 2460 1490 1100 1270 2460 4340 7360 9850 10400 6810 4610
3580 2490 1650 1110 1110 2400 4380 7350 9770 10200 6720 4550
3590 2460 1760 1190 1080 2370 4620 7290 9670 10000 6590 4490
3560 2320 1740 1170 1120 2360 5210 7210 9630 9980 6550 3780
3490 2160 1630 1120 958 2320 5990 7230 9610 9750 6500 3790
3440 2110 1690 1040 956 2250 6370 7310 9610 9550 6480 3850
3330 2040 1540 994 761 2410 6540 7330 9580 9370 6490 3910
3270 2100 1550 946 800 2540 6590 7450 9560 9220 6490 3950
3150 2060 1520 894 762 2680 6740 7570 9680 9080 6530 3940
3060 2230 1430 980 758 2910 6840 7660 9760 9030 6340 3910
3020 2060 1420 894 831 2990 6970 7870 9850 8930 6340 3800
3060 2110 1300 958 852 3160 6960 8070 10000 8810 6430 3750
3040 1960 1250 912 814 3440 6940 8310 10100 8700 6320 3720
3020 1940 1260 975 780 3640 6990 8580 10000 8580 6170 3570
3030 1960 1220 902 952 3790 7020 8750 10000 8540 6060 3450
3050 2090 1320 1110 1040 3790 7100 8880 10000 8460 5950 3280
3080 2040 1420 1090 1120 3760 7120 8990 10000 8440 5860 3260
Hi,
I have this matrix A and has NaN values. I need to remove NaN values from all the columns and write the values into one column (:).
3010 1970 1430 1000 1150 3720 7090 9150 10100 8370 5710 3250
3060 2120 1420 1140 1120 3700 7070 9410 10100 8290 5670 3140
2880 2020 1240 1070 1160 3650 6960 9600 10200 8240 5520 3080
2900 1840 1320 836 1120 3780 6940 9780 10300 8110 5450 3080
2730 1870 1230 1000 1060 4140 6790 9990 10500 8000 5360 3140
2640 1620 1160 770 1260 4410 6730 10200 10600 7900 5280 3200
2600 1600 934 711 1430 4560 6690 10200 10600 7720 5260 3120
2530 1480 828 698 1470 4550 6720 10300 10700 7660 5230 3100
2470 NaN 823 780 1630 4510 6780 10400 10900 7560 5120 2970
2580 NaN 871 820 1840 4360 6880 10300 11000 7500 4940 2750
2480 NaN 854 NaN 2070 NaN 6900 10200 NaN 7410 NaN 2700

回答 (1 件)

per isakson
per isakson 2014 年 7 月 4 日
編集済み: per isakson 2014 年 7 月 4 日
"I have this matrix A and has NaN values. I need
  1. to remove NaN values from all the columns and
  2. write the values into one column (:)."
Step one is not possible because it would result in columns with different length.
Switching the order of the steps will return a result
A = A(:);
A( isnan( A ) ) = [];

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by