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

Subscript Indices must be either real positive or logicals

1 Ansicht (letzte 30 Tage)
Asghar Ali
Asghar Ali am 13 Mär. 2017
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
I am getting above error in following code:
sets =ones(numel(fonts), numel(chars));
sets(end-349:end,:) = 2 ;
  1 Kommentar
Jeff am 13 Mär. 2017
I think you need to attach or include your indices files in a .mat file to facilitate diagnosis. My guess if you look at either end, fonts, or chars one of them are not either + integers or logicals.
Only a guess without all of the info

Antworten (1)

Star Strider
Star Strider am 13 Mär. 2017
What is the output when you run:
sets_size = size(sets)
  1 Kommentar
Walter Roberson
Walter Roberson am 13 Mär. 2017
numel(fonts) is probably less than 349


Community Treasure Hunt

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

Start Hunting!

Translated by