How to fix function calls showing wrong output on subsequent runs?

I am having function m.file and another seperatr m file to use those function calls to perform some operations. When using function calls to run a m.file, on the first run only, it shows the required output. On the subsequent runs, it shows errors or giving wrong output.

 Respuesta aceptada

It's maybe using values from prior runs. Try putting a
clear all
at the beginning of your main program, seperatr.m, and see if that fixes it.
Give the source code and full error message (absolutely ALL the red text, not just a snippet from it) if that does not fix it.

Más respuestas (0)

Productos

Versión

R2021b

Preguntada:

el 22 de Dic. de 2021

Respondida:

el 22 de Dic. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by