How can I access a record of the Command Window using MATLAB Grader?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
IFM
el 17 de Abr. de 2023
Comentada: IFM
el 18 de Abr. de 2023
I have asked learners to write a function that displays some messages to the Command Window.
In MATLAB I know I can use the diary function to access a record of the Command Window text, like this:
% Start the diary
diary CommandLog
% run the learner solution here
% Access the log then assess if correct
printOuts = fileread('CommandLog')
For some reason, this comes up as empty char in MATLAB Grader. Is there an alterative?
2 comentarios
Cris LaPierre
el 17 de Abr. de 2023
Could you share an example? How many outputs does their function create? How are they created?
Respuesta aceptada
Cris LaPierre
el 17 de Abr. de 2023
One workaround could be to write an assessment test that calls the functions using evalc. This captures the command window output in a variable you can then use for assessment.
Más respuestas (0)
Comunidades de usuarios
Más respuestas en Distance Learning Community
Ver también
Categorías
Más información sobre Historical Contests en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!