Skip to content
Snippets Groups Projects
Verified Commit 214cd796 authored by Thomas Lambert's avatar Thomas Lambert :helicopter:
Browse files

fix(plotpol): issue when missing data

parent c654ccdb
No related branches found
No related tags found
No related merge requests found
...@@ -81,15 +81,15 @@ function plotpolars(varargin) ...@@ -81,15 +81,15 @@ function plotpolars(varargin)
set(0, 'defaultTextInterpreter', 'latex'); % Default interpreter for all plots set(0, 'defaultTextInterpreter', 'latex'); % Default interpreter for all plots
plotsinglepolar(rad2deg(alpha), c_l, '$C_l - \alpha$', '$\alpha$ [deg]', '$C_l$ [-]'); plotsinglepolar(rad2deg(alpha), c_l, 'C_l - \alpha', '$\alpha$ [deg]', '$C_l$ [-]');
if nargin > 2 || nargin <= 1 if nargin > 2 || nargin <= 1
plotsinglepolar(rad2deg(alpha), c_d, '$C_d - \alpha$', '$\alpha$ [deg]', '$C_d$ [-]'); plotsinglepolar(rad2deg(alpha), c_d, 'C_d - \alpha', '$\alpha$ [deg]', '$C_d$ [-]');
plotsinglepolar(rad2deg(alpha), c_l ./ c_d, '$C_l/C_d - \alpha$', '$\alpha$ [deg]', ... plotsinglepolar(rad2deg(alpha), c_l ./ c_d, 'C_l/C_d - \alpha', '$\alpha$ [deg]', ...
'$C_l/C_d$ [-]'); '$C_l/C_d$ [-]');
plotsinglepolar(c_l, c_d, '$C_d - C_l$', '$C_l$ [-]', '$C_d$ [-]'); plotsinglepolar(c_l, c_d, 'C_d - C_l', '$C_l$ [-]', '$C_d$ [-]');
end end
if nargin > 3 || nargin <= 1 if nargin > 3 || nargin <= 1
plotsinglepolar(rad2deg(alpha), c_m, '$C_m - \alpha$', '$\alpha$ [deg]', '$C_m$ [-]'); plotsinglepolar(rad2deg(alpha), c_m, 'C_m - \alpha', '$\alpha$ [deg]', '$C_m$ [-]');
end end
end end
...@@ -98,21 +98,25 @@ end ...@@ -98,21 +98,25 @@ end
function plotsinglepolar(dataX, dataY, fTitle, fXlabel, fYlabel) function plotsinglepolar(dataX, dataY, fTitle, fXlabel, fYlabel)
% PLOTSINGLE Standardize polar plots % PLOTSINGLE Standardize polar plots
if ~exist('fTitle', 'var') if ~isempty(dataX) && ~isempty(dataY)
fTitle = '';
end
figure('PaperUnits', 'inches', 'PaperPosition', [0 0 1280 1024] / 250, 'Name', fTitle); if ~exist('fTitle', 'var')
plot(dataX, dataY); fTitle = '';
end
if exist('fXlabel', 'var') figure('PaperUnits', 'inches', 'PaperPosition', [0 0 1280 1024] / 250, 'Name', fTitle);
xlabel(fXlabel); plot(dataX, dataY);
end
if exist('fYlabel', 'var') if exist('fXlabel', 'var')
ylabel(fYlabel); xlabel(fXlabel);
end
if exist('fYlabel', 'var')
ylabel(fYlabel);
end
setgca();
end end
setgca();
end end
% -------------------------------------------------------------------------------------------------- % --------------------------------------------------------------------------------------------------
......
...@@ -17,7 +17,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -17,7 +17,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
## [4.0.0] 2022-06-09 - **plotpolar**: fix issue when unavailable data
## [4.0.0] - 2022-06-09
### Added ### Added
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment