imagesc graph axis setting probelm in Matlab Appdesigner
…
%% Loop start
numRows = length(shiftedDistance);
numCols = app.MaxMeasCountEditField.Value;
if isempty(app.dataMatrix)
app.dataMatrix = nan(numRows, numCols);
end
app.stop_loop = false;
if isempty(app.Ascan_cnt)
app.Ascan_cnt = 0;
end
while app.Ascan_cnt <= app.MaxMeasCountEditField.Value && app.stop_loop == false
% Add new data on the dataMatrix
if app.Ascan_cnt > numCols
% If I need to add cols
app.dataMatrix = [app.dataMatrix, nan(numRows, 1)];
numCols = numCols + 1;
end
app.dataMatrix(:, app.Ascan_cnt + 1) = newData;
% NaN to Zero
app.dataMatrix(isnan(app.dataMatrix)) = 0;
% image update
imagesc(app.UIAxes3_1, [1 app.Ascan_cnt], [min(shiftedDistance) max(shiftedDistance)], app.dataMatrix);
% xlim set
if app.Ascan_cnt > 50
xlim(app.UIAxes3_1, [app.Ascan_cnt – 49 app.Ascan_cnt]);
else
xlim(app.UIAxes3_1, [1 50]);
end
% ylim set
ylim(app.UIAxes3_1, [min(shiftedDistance) max(shiftedDistance)]);
colormap(app.UIAxes3_1, ‘gray’);
axis(app.UIAxes3_1, ‘tight’);
set(app.UIAxes3_1, ‘YDir’, ‘reverse’);
clim(app.UIAxes3_1, [0, app.ImageScalingEditField.Value]);
…
My code is like those.
I have a problem on setting the X axis in the Matlab appdesigner imagesc.
I want to add measured datas one by one on the defined Matrix.
And, I want the initial X axis with 50 components, and moving through when components are over 50s.
But, the datas add along arbitrary value even not integer.
what is my problem?…
%% Loop start
numRows = length(shiftedDistance);
numCols = app.MaxMeasCountEditField.Value;
if isempty(app.dataMatrix)
app.dataMatrix = nan(numRows, numCols);
end
app.stop_loop = false;
if isempty(app.Ascan_cnt)
app.Ascan_cnt = 0;
end
while app.Ascan_cnt <= app.MaxMeasCountEditField.Value && app.stop_loop == false
% Add new data on the dataMatrix
if app.Ascan_cnt > numCols
% If I need to add cols
app.dataMatrix = [app.dataMatrix, nan(numRows, 1)];
numCols = numCols + 1;
end
app.dataMatrix(:, app.Ascan_cnt + 1) = newData;
% NaN to Zero
app.dataMatrix(isnan(app.dataMatrix)) = 0;
% image update
imagesc(app.UIAxes3_1, [1 app.Ascan_cnt], [min(shiftedDistance) max(shiftedDistance)], app.dataMatrix);
% xlim set
if app.Ascan_cnt > 50
xlim(app.UIAxes3_1, [app.Ascan_cnt – 49 app.Ascan_cnt]);
else
xlim(app.UIAxes3_1, [1 50]);
end
% ylim set
ylim(app.UIAxes3_1, [min(shiftedDistance) max(shiftedDistance)]);
colormap(app.UIAxes3_1, ‘gray’);
axis(app.UIAxes3_1, ‘tight’);
set(app.UIAxes3_1, ‘YDir’, ‘reverse’);
clim(app.UIAxes3_1, [0, app.ImageScalingEditField.Value]);
…
My code is like those.
I have a problem on setting the X axis in the Matlab appdesigner imagesc.
I want to add measured datas one by one on the defined Matrix.
And, I want the initial X axis with 50 components, and moving through when components are over 50s.
But, the datas add along arbitrary value even not integer.
what is my problem? …
%% Loop start
numRows = length(shiftedDistance);
numCols = app.MaxMeasCountEditField.Value;
if isempty(app.dataMatrix)
app.dataMatrix = nan(numRows, numCols);
end
app.stop_loop = false;
if isempty(app.Ascan_cnt)
app.Ascan_cnt = 0;
end
while app.Ascan_cnt <= app.MaxMeasCountEditField.Value && app.stop_loop == false
% Add new data on the dataMatrix
if app.Ascan_cnt > numCols
% If I need to add cols
app.dataMatrix = [app.dataMatrix, nan(numRows, 1)];
numCols = numCols + 1;
end
app.dataMatrix(:, app.Ascan_cnt + 1) = newData;
% NaN to Zero
app.dataMatrix(isnan(app.dataMatrix)) = 0;
% image update
imagesc(app.UIAxes3_1, [1 app.Ascan_cnt], [min(shiftedDistance) max(shiftedDistance)], app.dataMatrix);
% xlim set
if app.Ascan_cnt > 50
xlim(app.UIAxes3_1, [app.Ascan_cnt – 49 app.Ascan_cnt]);
else
xlim(app.UIAxes3_1, [1 50]);
end
% ylim set
ylim(app.UIAxes3_1, [min(shiftedDistance) max(shiftedDistance)]);
colormap(app.UIAxes3_1, ‘gray’);
axis(app.UIAxes3_1, ‘tight’);
set(app.UIAxes3_1, ‘YDir’, ‘reverse’);
clim(app.UIAxes3_1, [0, app.ImageScalingEditField.Value]);
…
My code is like those.
I have a problem on setting the X axis in the Matlab appdesigner imagesc.
I want to add measured datas one by one on the defined Matrix.
And, I want the initial X axis with 50 components, and moving through when components are over 50s.
But, the datas add along arbitrary value even not integer.
what is my problem? appdesigner, imagesc, axis, matlab gui, matlab MATLAB Answers — New Questions