Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Cell Array of Strings function help

1 visualización (últimos 30 días)
krushnasamy subramaniyan
krushnasamy subramaniyan el 6 de Jun. de 2015
Cerrada: Walter Roberson el 15 de Jun. de 2015
Write a function called censor whose first input argument is a cell vector (row or column) of strings and whose second input argument is a string. It removes each element of the cell vector whose string is either identical to the second input argument ... (PLEASE FINISH THIS STATEMENT HERE)
function mystr=censor(str,substr)
str={str};
element=substr;
str(strcmp(str,element))='';
for i=1:length(str)
if iscell(str{i})
str{i}(strcmp(str{i},element))='';
end
end
  3 comentarios
James Tursa
James Tursa el 6 de Jun. de 2015
Editada: James Tursa el 6 de Jun. de 2015
I have edited your question and moved the title inside the question itself. It looks incomplete, so please edit and replace my TEXT above with the remaining question, and then tell us what specific problems you are having. Then we can help you. E.g., does it give you an error (if so, post the entire error for us to see), does it give you wrong results, etc.
Thanks for making an effort and posting your attempt.
dpb
dpb el 6 de Jun. de 2015
Is this not the duplicate of http://www.mathworks.com/matlabcentral/answers/221886 where you've been given several hints that haven't followed up on?
As noted there, the substitution for the string in the cell is NOT the proper operation with which to begin per the problem statement as given in one of the follow-ups at that thread.
Continue the conversation in one thread only, please...

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by