issues with plots with multiple information
Show older comments
I need to plot those information but it's show me "Error using plot
Vectors must be the same length."
All the information provided and text file.
clear;
clf('reset');
max_iterations = 1000;
xs = 1: max_iterations;
num_devices=50;
ys_00=importdata('NOMA_users.txt');
ys_01=importdata('NOMA_users.txt');
ys_02=importdata('NOMA_users.txt');
ys_00 =NOMA_users(1:max_iterations, 1);
b = bar(xs, ys_00);
plot(xs, ys_00);
hold on;
plot(xs, ys_01);
plot(xs, ys_02);
ylim([0 num_devices]);
title({title_text_1; title_text_2; title_text_3})
xlabel("Iterations");
ylabel("Number of selected clients");
% legend({'Number of selected clients by LEARN ', ...
% 'LEARN (after energy filtering)', ...
% 'GREED'}, ...
% 'location', 'northwest');
% set(gca,'XMinorTick','on','YMinorTick','on');
% grid on;
TextFontSize=25;
LegendFontSize = 20;
set(0,'DefaultAxesFontName','Times',...
'DefaultLineLineWidth',1,...
'DefaultLineMarkerSize',6);
set(gca,'FontName','Times New Roman','FontSize',TextFontSize);
hold off;
clear;
figure;
clf('reset');
plot(xs,ys1, '-bo');
ylim([0 num_devices]);
% title({title_text_1; title_text_2; title_text_3})
ylabel(ylabel_text_1);
xlabel('Mean value of $\mu_{i}$', 'interpreter', 'latex');
4 Comments
Lateef Adewale Kareem
on 19 Jul 2022
Thats because the length are not the same. Send in the data, so I can see how to fix it
Brave A
on 19 Jul 2022
Brave A
on 20 Jul 2022
Brave A
on 20 Jul 2022
Accepted Answer
More Answers (0)
Categories
Find more on Polar Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!