Logic array changing when saving then loading .mat file

3 visualizaciones (últimos 30 días)
Ennis
Ennis el 25 de En. de 2024
Editada: Matt J el 25 de En. de 2024
My code creates a variable that I need to save into a .mat file then pull to use in another program. Once opening the loaded .mat file, the logical array changes from all 0 to all 1. Anyone has an idea on what could be causing this?
  1 comentario
the cyclist
the cyclist el 25 de En. de 2024
This is probably impossible to debug unless you tell us the exact steps (with example data) that you used. Don't just describe what you did. Share the code (or UI steps) that you actually used.

Iniciar sesión para comentar.

Respuestas (1)

Matt J
Matt J el 25 de En. de 2024
Editada: Matt J el 25 de En. de 2024
As @the cyclist says, we really need to be given steps to reproduce this. The only thing I can guess is that maybe you tried to convert a bit string in char form into a logical array before you saved it, e.g.,
bits = logical('00000')
bits = 1×5 logical array
1 1 1 1 1

Categorías

Más información sobre Variables en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by