Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

how to ask the User to inform elements to compose a matrix

1 Ansicht (letzte 30 Tage)
felipe gonzalez
felipe gonzalez am 2 Aug. 2015
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
for example:
I ask him the first element, then the second and so on accumulating in the vector.
what I did was
Neuron = [ ] ;
for j=1:(b-1)
     p = input ('enter the number of the neurons', j, 'layer');
     neuron = [neuron p];
end
it happens that when I thus gives error the message is matlab
Too many input arguments.
please someone help me
thank you very much

Antworten (2)

Azzi Abdelmalek
Azzi Abdelmalek am 2 Aug. 2015
Bearbeitet: Azzi Abdelmalek am 2 Aug. 2015
I think it always gives error.
b=4
Neuron = zeros(1,b-1) ;
for jj=1:b-1
p = input ('enter the number of the neurons');
Neuron(jj) = p;
end

Matt J
Matt J am 2 Aug. 2015
Bearbeitet: Matt J am 2 Aug. 2015
Something like this, maybe.
Neuron = nan(1,b-1); ;
for j=1:(b-1)
Neuron(j) = input (['Enter the number of neurons in layer #' num2str(j) ': ']);
end

Diese Frage ist geschlossen.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by