Loading csv file in a Matlab function

2 ビュー (過去 30 日間)
Salima
Salima 2014 年 11 月 16 日
コメント済み: Salima 2014 年 11 月 23 日
Solved!
  2 件のコメント
Guillaume
Guillaume 2014 年 11 月 21 日
Please don't edit your question to remove its content once it's been solved.
Salima
Salima 2014 年 11 月 23 日
Hello Guillaume
I'm really sorry for that. I'm unfortunately unavailable to correct my mistake. But I ensure you that I would keep this in mind and I wouldn't repeat this. If it is all right can you help me with a problem?
Thanks!

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

採用された回答

Guillaume
Guillaume 2014 年 11 月 16 日
You certainly won't be able to access matrix outside of your function since it's not a return value.
As for tvec and data, if you invoke your function from the workspace with:
[tvec, tdata] = load_measurements('somefile.txt');
they will appear in your workspace.
Any variable defined in a function are private to that function unless they are return values. You actually have to ask for the return value in the function call to get them.
  1 件のコメント
Guillaume
Guillaume 2014 年 11 月 16 日
As it's a completely different question, you should have started a new one.
Anwyay, it's very simple, assuming you want all elements to the row equal to -1:
data(all(data == -1, 2), :) = [];
If it's any element in the row equal to -1, replace the all with any

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWhos についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by