Values in cell array keep getting overwritten
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
1 voto
Condividi un link a questa risposta
18 Commenti
Condividi un link a questo commento
Condividi un link a questo commento
Condividi un link a questo commento
- for some unknown reason you decided to add another exist call after loading the file data. Consider the two possibilities a) if the file does not exist, then trying to import its data will throw an error, so your check does nothing, or b) if the file does exist, then load has already imported its data, in which case your exist is total superfluous. That is why my code already checked if the file exists before loading its data.
- You included the part of the code that actually stores the imported data in an if statement that runs only when the file does not exist (how do you imagine storing data from non-existent files?)... but this is all nested inside my original if statement which already checks if the file exists: can you tell me how it is ever possible for both if statements to have true conditions? i.e. for your if statement to run, a file has to both exist and not exist. Perhaps you are checking for Schroedinger's file?
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
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
Condividi un link a questo commento
- at the end of your script,
- in the command window.
Condividi un link a questo commento
Condividi un link a questo commento
Condividi un link a questo commento
Condividi un link a questo commento
Più risposte (1)
0 voti
Condividi un link a questa risposta
1 Commento
Condividi un link a questo commento
- the use of cd (slow, difficult to debug), rather than absolute/relative filenames.
- string concatenation instead of fullfile.
- loading directly into the workspace.
Categorie
Scopri di più su Shifting and Sorting Matrices in Centro assistenza e File Exchange
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)
