Read in text values from CSV file into matrix
이전 댓글 표시
Hi, i'm trying to read in a csv file that has a row full of words each in a separate cell.
Current code
clc;
clear;
%Create Matrix
dictionary = [];
dictionary = readtable('Dictionary.csv');
%pick random word
word_index = randi(9876, 1);
disp(word_index);
%selected_word = dictionary(word_index);
The problem is that if I use extractFileText it reads it in as 1x1 string and if I use readtable it reads it in as a 0*9885 table (There are 9885 words in the csv file). I have also tried readmatrix and xlsread
What function would allow me to read in the csv file into the matrix where each word in the csv file is its own element in a 1*9885 matrix?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!