fprintf into a stored variable
Al momento, stai seguendo questa domanda
- Vedrai gli aggiornamenti nel tuofeed del contenuto seguito.
- Potresti ricevere delle e-mail a seconda delle tuepreferenze per le comunicazioni.
Si è verificato un errore
Impossibile completare l'azione a causa delle modifiche apportate alla pagina. Ricarica la pagina per vedere lo stato aggiornato.
0 voti
Condividi un link a questa domanda
Risposta accettata
0 voti
Condividi un link a questa risposta
10 Commenti
Condividi un link a questo commento
Condividi un link a questo commento
Condividi un link a questo commento
Condividi un link a questo commento
Condividi un link a questo commento
- "How do I stop it from using the same 'i' for each while loop"   Do you mean the same i in the first and second while loop? In the code you show i is incremented but not used.
- Did you inspect the values of m and s after running the code? These values are they not the ones you expect?
Condividi un link a questo commento
- I was using the 'i' to count my iterations for the problem. I may be doing that incorrectly. Yes, I was referring to the 'i' in the first and second while loop.
- They are the values I expect but the iterations are incorrect because the second while loop is starting from the last 'i' value of the first loop.
Condividi un link a questo commento
Condividi un link a questo commento
Condividi un link a questo commento
- "but I got an error"   we cannot help if you don't show what you did and what error Matlab reported.
- "a better way of achieving this"   length(s) and length(m) tell the number of iterations in the two loops.
Condividi un link a questo commento
- two ways to count the number of loop iterations
- two ways to store result in the loop

Più risposte (0)
Categorie
Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange
Prodotti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
Americhe
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
