Timescope unexpected change after resizing window

7 visualizaciones (últimos 30 días)
Luca Carlino
Luca Carlino el 16 de En. de 2024
Editada: Luca Carlino el 17 de En. de 2024
Hello,
I have a problem when using timescope.
After running the code below, the timescope appears as shown in Fig1 (attached). If I try to resize the timescope window (or to maximize it, by clicking on the Maximize button in the top-right), the timescope changes and becomes as shown in Fig2 (attached).
It seems something is wrong.
Does someone knows a solution or a work-around?
clear; clc; close all;
%Signal 1 Parameters
T = 300;
Ts = 1e-2;
fs = 1/Ts;
%Signal 2 Parameters
T_2 = T;
Ts_2 = Ts/100;
fs_2 = 1/Ts_2;
%Time Vectors
t = (0:Ts:T-Ts)';
t_2 = (0:Ts_2:T_2-Ts_2)';
%Input Signals
Signal_1 = log(1 + t);
Signal_2 = 5*exp(-t_2/100).*cos(t_2);
%TIMESCOPE
scope = timescope(SampleRate=[fs fs_2], TimeSpanSource="property", TimeSpan=T);
scope.LayoutDimensions = [2,1];
scope(Signal_1, Signal_2);
release(scope);

Respuesta aceptada

Hassaan
Hassaan el 16 de En. de 2024
Here are a few potential solutions and workarounds that you might consider:
  1. Graphics Drivers: Ensure that your graphics drivers are up to date. Outdated graphics drivers can sometimes cause rendering issues in MATLAB figures.
  2. MATLAB Version: Check if you're using the latest version of MATLAB. If not, consider updating MATLAB as bugs are often fixed in newer releases.
  3. MATLAB Support: If updating MATLAB does not solve the issue, consider reaching out to MATLAB's customer support or checking their forums for known issues and solutions.
  4. Redraw Time Scope: As a workaround, you might try forcing the Time Scope to redraw after resizing. You can do this by calling drawnow or refresh after resizing the window.
  5. Docking Figures: Try docking the Time Scope within the MATLAB desktop environment. Sometimes, docking can resolve rendering issues related to window resizing. You can dock the Time Scope by using the command set(scope,'WindowStyle','docked') before you call the scope function.
  6. MATLAB Scripts Instead of Time Scope: If the issue persists and you cannot find a solution, consider using MATLAB plotting functions such as plot to create your own custom plots. While this requires more effort, it gives you full control over the rendering and resizing behavior of the plots.
  7. Check for Updates or Patches: Sometimes, MathWorks releases patches for specific bugs. Check if there are any available patches for your MATLAB version that address Time Scope issues.
  8. Use Another Computer: If possible, try running your code on a different computer with MATLAB installed to see if the issue is specific to your machine or the MATLAB installation.
  9. Alternative Visualization Tools: If the issue is critical and cannot be resolved, consider using alternative visualization tools for your data, such as exporting the data to Python and using libraries like Matplotlib for plotting, or using other specialized data visualization software.
Since the Time Scope is part of Simulink's visualization suite, if none of the above solutions work, it may be a bug that needs to be addressed by MathWorks themselves. In that case, providing feedback to MathWorks, including the version of MATLAB you are using and the details of the issue, would be the next step.
------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.
Professional Interests
  • Technical Services and Consulting
  • Embedded Systems | Firmware Developement | Simulations
  • Electrical and Electronics Engineering
Feel free to contact me.
  2 comentarios
Luca Carlino
Luca Carlino el 17 de En. de 2024
Editada: Luca Carlino el 17 de En. de 2024
First of all, thank you for the detailed answer. I have decided to open a bug report with MathWorks, as it seems the most appropriate action right now.
Regarding your proposed solutions/workarounds, this is what I have tried so far:
  1. Graphics Drivers: Should be OK (see below);
  2. MATLAB Version: The version is not the latest, but I can't "easily" updated it on the computer I am using, since it is a work-computer managed by the company (this includes updates to drivers, operative system, and so on). Of course, I could ask for a version update, but first of all, I need to make sure that: a) it is actually a bug; b) it is fixed via updating;
  3. MATLAB Support: Bug report was done;
  4. Redraw Time Scope: I tried both methods, they didn't work;
  5. Docking Figures: Unfortunately, also doesn't work. If you try, you get the error (red text) copy-pasted below;
  6. MATLAB Scripts Instead of Time Scope: The reason I am trying to use timescope is due to some key features, in particular data cursors, which are quite advanced. Do you know a simple way to replicate this feature with plot?
  7. Check for Updates or Patches: I did a quick search, and did not find this specific issue. Depending on what happens in the meantime, I may (or may not) do a deeper search in the future;
  8. Use Another Computer: I tried on another computer. The result is the same, the issue is still there;
  9. Alternative Visualization Tools: As of now, I need to stick to MATLAB. This should be the last resort, if everything else fails.
Thanks again for your support. If you have workarounds similar to point 4 or point 5 (i.e. workarounds which do not require changing MATLAB version, updates, and so forth), feel free to share them - as of now, they are the best route to go.
Error (related to point 5):
The name 'WindowStyle' is not an accessible property for an instance of class 'timescope'.
Error in dsp.webscopes.mixin.PropertyValueValidator/set
Error in timescope_bug (line 23)
set(scope,'WindowStyle','docked');
Hassaan
Hassaan el 17 de En. de 2024
You are welcome. Will try.
------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback. Professional Interests Technical Services and Consulting Embedded Systems | Firmware Developement | Simulations Electrical and Electronics Engineering Feel free to contact me

Iniciar sesión para comentar.

Más respuestas (0)

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by