Result only printed on screen and show in the ans variable in the workspace
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
KnowledgeSeeker
el 18 de En. de 2014
Comentada: KnowledgeSeeker
el 18 de En. de 2014
This is my code, it read the entire text file and search for a specific word and returns the line that contains that words using token in a cell array. The problem is my assigned variables are not returned not showed in the workspace of my function....
ans: result
0 comentarios
Respuesta aceptada
Amit
el 18 de En. de 2014
If the assigned variables in your code are different than sortedWords, they wont show up in the workspace because they are only for this function.
In order to have then in the workspace, you either need to set them as an output of the function like
function [sortedWords,AssignVal1 ... ] = readFromGigaWord(sortedWords,count)
or you need to run this not as a function but a script.
4 comentarios
Más respuestas (1)
Image Analyst
el 18 de En. de 2014
You can use allwords() http://www.mathworks.com/matlabcentral/fileexchange/27184-allwords to parse your sentence into separate words. It's a heck of a lot easier than using strtok().
Then you can use strfind() to look for a particular word.
Ver también
Categorías
Más información sobre Variables en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!