How can i fix this error, Too many input arguments?
20 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi Everyone, i'm having an error when i try to display the Year, Month, and Day of one event. This is the code line with the error:
fprintf('Grupo 1: '); disp(AO1, MES1,DIA1(i(1)));
There are three diferents matrix vectors into it and these are:
AO1, MES1,DIA1
I want get that the script throw me the combination of those vectors because it compose a day.
I let you tabs down the code.
%% Import data from spreadsheet % Script for importing data from the following spreadsheet: % % Workbook: C:\Users\elect\Documents\MATLAB\ProgramacionMATLAB\IyTDIA30a.xlsx % Worksheet: Hoja1 %% Import the data [~, ~, raw0_0] = xlsread('C:\Users\elect\Documents\MATLAB\ProgramacionMATLAB\IyTDIA30a.xlsx','Hoja1','B1:D9775'); [~, ~, raw0_1] = xlsread('C:\Users\elect\Documents\MATLAB\ProgramacionMATLAB\IyTDIA30a.xlsx','Hoja1','H1:I9775'); raw = [raw0_0,raw0_1]; raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''};
%% Exclude rows with non-numeric cells I = ~all(cellfun(@(x) (isnumeric(x) islogical(x)) && ~isnan(x),raw),2); % Find rows with non-numeric cells raw(I,:) = [];
%% Create output variable data = reshape([raw{:}],size(raw));
%% Allocate imported array to column variable names AO1 = data(:,1); MES1 = data(:,2); DIA1 = data(:,3); tmedC1 = data(:,4); IrrGlodiawm1 = data(:,5);
%% Clear temporary variables clearvars data raw raw0_0 raw0_1 I; %% Clear temporary variables clearvars data raw raw0_0 raw0_1 R;
%El analisis desarrollado para determinar la media y la tendencia de los %ultimos 30 años tanto de temperatura y de irradiacion close all %analisis de la data por means y kmeans Tem=mean(tmedC1); Irr=mean(IrrGlodiawm1);
%%Tamaño de las datas analizadas TM=size([tmedC1, IrrGlodiawm1]);
% %clausterización por kmean [idx, C, sumd, D]=kmeans([tmedC1,IrrGlodiawm1], 7); % % %********************************************************% % %Graficar los grupos scatter(IrrGlodiawm1, tmedC1, 25,idx,'filled'); hold on; grid on; plot(C(:,2),C(:,1),'rx'); % legend ('D1', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7'); title 'Dias típicos en Bilbao'; ylabel 'Temperatura (C)'; xlabel 'Irradiación (w·m2)';
% %Calcular "el día" más cercano a cada centroide: [mind,i]=min(D); fprintf('Grupo 1: '); disp(AO1, MES1,DIA1(i(1)));
0 Kommentare
Antworten (1)
Steven Lord
am 11 Okt. 2016
The disp function accepts exactly one input argument. You're trying to call it with three input arguments. You probably want to expand the format specification in your fprintf call to include three formatting operators (or call fprintf up to three additional times, one per array you want to display) and use fprintf to display those arrays.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!