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?

 Réponse acceptée

Stephen23
Stephen23 le 22 Août 2022

0 votes

READCELL

Plus de réponses (0)

Catégories

Tags

Question posée :

le 22 Août 2022

Commenté :

le 22 Août 2022

Community Treasure Hunt

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

Start Hunting!

Translated by