placing my file in matlab code

1 回表示 (過去 30 日間)
fereshteh izadi
fereshteh izadi 2016 年 1 月 11 日
編集済み: fereshteh izadi 2016 年 1 月 11 日
hello,
I am going to run a matlab code as I attached, I have a txt file as input for algorithm like below
> head(mycounts1[,1:4])
AT1G01060 AT1G01170 AT1G01180 AT1G01260
AT1G01060 1 0 0 0
AT1G01170 0 1 0 0
AT1G01180 0 0 1 0
AT1G01260 0 0 0 1
AT1G01380 0 0 0 0
AT1G01490 0 0 0 0
whenever I upload my file and run the code Get error.. how i can place my file or tell the code run on my file please?
thank you so much
  2 件のコメント
Walter Roberson
Walter Roberson 2016 年 1 月 11 日
How are you "uploading" your file?
fereshteh izadi
fereshteh izadi 2016 年 1 月 11 日
I pressed import file then I pressed Run button but I always get error

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 1 月 11 日
You cannot invoke that code by pressing the "Run" button. You need to invoke that code from the command line, passing in the name of the matrix that you imported. For example if you imported MyData1138 then you would go to the command line and give the command
result = ND(MyData1138)
  1 件のコメント
fereshteh izadi
fereshteh izadi 2016 年 1 月 11 日
編集済み: fereshteh izadi 2016 年 1 月 11 日
sorry you mean i should simply mention the name of my txt file??? for example no need to something like fid = fopen('myfile.txt', 'rt') then result = ND(fid) I did like below >> fid = fopen('myfile.txt'); >> ND Error: File: ND.m Line: 70 Column: 12 "varargin" previously appeared to be used as a function or command, conflicting with its use here as the name of a variable. A possible cause of this error is that you forgot to initialize the variable, or you have initialized it implicitly using load or eval. thank you

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by