Read in text values from CSV file into matrix
Mostrar comentarios más antiguos
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?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Workspace Variables and MAT Files en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!