How do I publish results with an input command?
13 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
kevin nguyen
am 9 Sep. 2015
Beantwortet: San N
am 16 Dez. 2020
When I publish my code, I get an error saying there is no value for n. This is correct,so I'm wondering if there is a way to publish while saying n =8. I'm trying to make a random number column vector nx1 then sort it by descending values.
here is my code:
n=input(' enter an integer:');
v=randn(n,1)
w=sort(v,'descend')
0 Kommentare
Akzeptierte Antwort
Hamoon
am 9 Sep. 2015
publish(file,'evalCode',false)
3 Kommentare
Hamoon
am 10 Sep. 2015
save your script as mycode.m then execute this:
publish('myCode.m','evalCode',false)
As you know if your current folder is different from where you saved your script, you need to pass the full path of your script. eg.
publish('C:\work\myCode.m','evalCode',false)
Weitere Antworten (1)
San N
am 16 Dez. 2020
IF I want to publish the outputs after getting an input from user, how can I do it ?
0 Kommentare
Siehe auch
Kategorien
Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!