readtableが勝手にアンダーバーで分割するのを通常通りコンマで分割してほしい
16 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
% ファイルパスの指定
file1 = 'ssim_values.csv';
file2 = 'dmos.csv';
T1 = readtable(file1)
T2 = readtable(file2)
添付のcsvファイルを読み取り、テーブルに格納するような上記のコードを実行すると、file1の方だけ、アンダーバーで分割してしまうので、file2のようにコンマで区切りたいです、どうすればいいですか?
以下、実行結果です。(一部簡略化のため消去)
T1 =
20×3 table
Var1 Var2 Var3
_______ ____ ___________________
{'I01'} 1 {'01.png,1.000000'}
{'I01'} 1 {'02.png,0.997691'}
{'I01'} 1 {'03.png,0.980043'}
{'I01'} 1 {'04.png,0.947295'}
{'I01'} 1 {'05.png,0.888258'}
{'I01'} 2 {'01.png,1.000000'}
{'I01'} 2 {'02.png,0.991826'}
{'I01'} 2 {'03.png,0.954603'}
{'I01'} 2 {'04.png,0.924066'}
{'I01'} 2 {'05.png,0.900828'}
{'I01'} 3 {'01.png,1.000000'}
{'I01'} 3 {'02.png,0.993288'}
{'I01'} 3 {'03.png,0.976569'}
{'I01'} 3 {'04.png,0.959581'}
{'I01'} 3 {'05.png,0.926680'}
{'I01'} 4 {'01.png,1.000000'}
{'I01'} 4 {'02.png,0.598222'}
{'I01'} 4 {'03.png,0.496983'}
{'I01'} 4 {'04.png,0.462533'}
{'I01'} 4 {'05.png,0.387672'}
T2 =
10125×4 table
dist_img ref_img dmos var
_________________ ___________ ____ _____
{'I01_01_01.png'} {'I01.png'} 4.57 0.496
{'I01_01_02.png'} {'I01.png'} 4.33 0.869
{'I01_01_03.png'} {'I01.png'} 2.67 0.789
: : : :
{'I81_25_03.png'} {'I81.png'} 4.3 0.526
{'I81_25_04.png'} {'I81.png'} 4.13 0.499
{'I81_25_05.png'} {'I81.png'} 3.27 0.772
0 commentaires
Réponses (1)
Kojiro Saito
le 8 Juil 2023
readtable のオプションでDelimiterを指定できますので、コンマで区切るように指定してみたら実現できます。
file1 = 'https://jp.mathworks.com/matlabcentral/answers/uploaded_files/1428783/ssim_values.csv';
T1 = readtable(file1, 'Delimiter', ',')
0 commentaires
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!