creating different arrays on the fly
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
I have an 1500 x 200 array and want to create arrays for some columns that would have different name. The new array name should be a composition of text and array's column number. Then I want to place the data from the specific column of the original array into the new array with the same column name.
For example: Take the data in 5th column of the original 1500 x 200 array and programaticaly put it into an array called "col5". Then do it for column 10, column 12, etc.
Any help would be greatly appreciated.
採用された回答
Matt Fig
2011 年 3 月 9 日
Just in case you didn't read the link Paulo gave, DON'T DO THIS!
You will end up way too many variables, then you will be asking questions like, "How can I find the average of my many many arrays?" or "How can I do XX with all of these arrays?" Instead use a cell array or keep them in the array they are in already. Why complicate things?
12 件のコメント
Carlos Freyre
2011 年 3 月 9 日
Ok. Thanks for the heads up. I'll have to rethink the logic flow.
Paulo Silva
2011 年 3 月 9 日
I deleted my answer (the one that was accepted and got -1 vote from Sean de, thanks dude, it's always good to know that my time here is just wasted), my participation on Matlab Answers as come to an end, good luck to you all, bye
+1 vote to you Matt Fig and Carlos Freyre please do accept Matt Fig answer, thanks
Jan
2011 年 3 月 9 日
@Paulo: Bye. 68 people have accepted your answers and much more have voted answers. I did not agree with all of your answers or comments, but I esteemed and will miss your constructive help here.
I have the impression, that the voting and reputation system can frustrate the most productive users. Is MATLAB Answers + voting a burn-out machine?
Matt Fig
2011 年 3 月 9 日
@Paulo, I do not think that you should take things so personally. Nobody will be able to write answers that everyone agrees with, but so what? If we all learn from each other and don't take differences of opinion to heart, perhaps we can help many people learn with us.
Your contributions here will be missed if you disappear.
Matt Tearle
2011 年 3 月 9 日
Whoa. I think I missed something...
Matt Fig
2011 年 3 月 9 日
I think what you missed can be inferred from Paulo's comment above and several of his other recent comments on Answers...
Paulo Silva
2011 年 3 月 10 日
@Jan, I don't care about reputation/points, I removed some of my answers that were accepted and others that got votes! also gave votes against my own answers without any problem, the thing I care is that the answers accepted are the best ones and the time spent creating them be appreciated, it's rude to say -1 vote just because someone doesn't like our answer, even if that answer is exactly what the OP wanted + extra information.
@Matt Fig, the problem I see with Matlab Answers is that the OPs can chose any answer good or bad without waiting for feedback from other Matlab users, they come here to make the question and come back later to get the answers, there's no quality test besides waiting for the best answer to get the most votes, nobody waits unless there's no answer or the provided ones aren't 100% satisfactory.
@Matt Tearle, please keep up teaching others how to love matlab :)
Matt Fig
2011 年 3 月 10 日
@Paulo, what you say is true, which is why I simply do not equate an answer being chosen as best with it being the best. Perhaps you are really making a recommendation to have a "OP best answer" and another, "Community voted best answer." Even this will not be perfect. Bottom line, like the FEX, MATLAB Answers isn't perfect so don't take it personally. If you are here to help, then the rest is just fluff. That's my $.02.
Paulo Silva
2011 年 3 月 10 日
I will try to ignore some things in the future, thanks for the wise words Matt :) I decided to keep my regular participation for now.
Matt Tearle
2011 年 3 月 10 日
OK, I take it there was something of a flame war in the comments of Paulo's answer?
I am sorry to hear that. My main interest here is that I want this forum to be useful and successful. Paulo, the best way for that to happen is for the top people to keep doing what they've been doing so far. IOW, I'll add my name to those asking you to keep contributing, and ignore the crud. (We all have to have a sense of humor about some things.) With that said, I do want ideas on how to reduce the crud. A key aspect of MATLAB Answers is that other users should be able to find information/help by searching for questions and finding the most relevant information in the accepted and top-ranked answers. If you have ideas on how to make that happen, let's hear them. Maybe in Walter's Wish-List question. Or even start a new question, with your own suggestion as the first answer.
Paulo Silva
2011 年 3 月 10 日
@Matt Tearle, it was not a flame war, just someone commented "-1 vote" on my answer, don't really know if that person was able or not to vote down my answer but it was kind of rude after the trouble I had to come up with code to do what was asked for and to provide a link for the proper way to do it, Matt Fig posted his answer after mine has you can see "Just in case you didn't read the link Paulo gave, DON'T DO THIS!...", my answer was the one accepted but I decided to remove it.
I won't make more suggestions, had enough problems, the only thing that should change is the way people think, if you don't agree with something just say why instead of voting down.
Jan
2011 年 3 月 10 日
@Paulo: "The only thing that should change is the way people think"?! I'm sure that MATLAB Answers users do not want their way of thinking to be changed.
In fact, "-1 vote" is not a flame war. It is not very helpful, but simply the expression of a opinion deviating from yours. "-1E6 votes" would be another story.
@Matt: "The rest is just fluff". I asked Leo to translate this: "Der Rest ist Flockenbrennstoff". Ok. I have nothing to add.
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
参考
2011 年 3 月 9 日
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- 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)
