Decrease time to upload a figure
1 view (last 30 days)
I am traying to develop an instrumented insole. I have 5 sensor, where I am measuring the change of voltage that it is generated when the pressure in the sensor change. As the sensor is obviolsy only in one pixel, I want to simulate that the pressure is decreasing around 3-4cm, that following my calcules are about 100pixels.
Pressure_points is a function where I enter the foot image, the radius that I have mentioned (95 pixels in this case), Paux are the coordinates of the five sensors and S are their voltage value, then I obtain an image which name es Pedobarography.
So first of all I start reading the voltage values, and if they are cero, I represent the simple foot, waiting in the second 'while', in order to not repeat every time the same figure. When a chagne in the voltage values is deected in any sensor, the process is repeated, but here is the problem. I have cheked that the function Pressure_points is not the problem because without drawing the heatmap it runs quickly, but when I try to upload the foot heatmap with the sensor changes, it runs very slow because it has to draw everything again.
To sum up, is there any way to draw the changes in the same heatmap quickly, to have these change in real time.
Thanks for your attention.
while bt.Status == 'open'
if s1==0 && s2==0 && s3==0 && s4==0 && s5==0
%Locate the pressure sensor, and the pressure created in each of them
%Pressure is drawn in mV
[X, h] = contourf(Pedobarography,'LevelList',[0.1:1]);
while s1==0 && s2==0 && s3==0 && s4==0 && s5==0
while s1>0 || s2>0 || s3>0 || s4>0 || s5>0
% Locate the pressure sensor, and the pressure created in each of them
% Pressure is drawn in mV
[X, h] = contourf(Pedobarography,'LevelList',[0.1:20:max(S)]);
Philippe Lebel on 12 Dec 2019
Edited: Philippe Lebel on 12 Dec 2019
In addition to @Looky 's answer, try to remove the
from the while loop, I'm pretty sure you only need to do it once.
Maybe set a flag in the while loop to call it on the first iteration.