主要内容

Results for


[INDEX]
--------------------------------------------------------------------------------------------------------------------------------------
[MOTIVATION]
Why should we use markups in the body of our questions?
The answer is a question: which of the two versions is more likely to be understood in a glimpse and has more chances to be answered by our readers?
.
< Consider the following question >
I have a vector of weights W=[10,20,30,50,23434,1,2.4,2] and a matrix A=rand(100,8) and I would like to find the row-wise weighted sum of A. I am proceeding in the following way: B=zeros(size(A)); for c=1:numel(W) B(:,c)=A(:,c)*W(c); end B=sum(B,2); Somehow I get huge numbers can you please help?
.
< Now, consider its formatted version >
I have a vector of weights W = [10,20,30,50,23434,1,2.4,2] and a matrix A = rand(100,8) and I would like to find the row-wise weighted sum of A.
I am proceeding in the following way:
B = zeros(size(A));
for c = 1:numel(W)
B(:,c) = A(:,c)*W(c);
end
B = sum(B,2);
Somehow I get huge numbers can you please help?
--------------------------------------------------------------------------------------------------------------------------------------
[AKNOWLEDGMENTS]
In alphabetical order by nickname, thanks for their suggestions to:
Walter Roberson
--------------------------------------------------------------------------------------------------------------------------------------
[LOG]
  • 06 Aug 2011, 13:17 BST - created and added boldface.gif
  • 06 Aug 2011, 14:59 BST - added italic.gif
  • 06 Aug 2011, 18:58 BST - added index section
  • 07 Aug 2011, 00:03 BST - added code.gif and tutorial series section
  • 07 Aug 2011, 01:50 BST - added monospaced.gif, numlist.gif, bullist.gif and hyperlink.gif
  • 13 Aug 2011, 14:27 BST - added motivation section
  • 18 Aug 2011, 01:44 BST - added aknowledgments section and link to wish-list
--------------------------------------------------------------------------------------------------------------------------------------
[TUTORIAL Series]
Do not forget to read the Markup help (located on the top-right corner of the Body pane)
Vote on Wish-list for MATLAB Answer sections my post if you think that a tutorial section on top of Answers could be useful.
I think a lot about how to more effectively teach MATLAB, internally to new hires, but also through my blog.
How did you learn MATLAB, what knowledge of programming did you have coming into learning MATLAB? When did you learn it is important also as the resources available have expanded radically in the last 15 years.
Answers from new users who are just beginning down this path are of particular interest, as those are who we can help the most.
Now, I am still a novice when it comes to programming. I believe MATLAB is definitely a great programming tool, one that I can play with, particularly, when I have free time.
I would love to hear from all answerers, what are the ways that can make one proficient in this field?
This topic is for unexpected or bizarre or humorous references to MATLAB. Specific citations would be appreciated.
Please post the easter eggs that you have found so far if they aren't already posted by someone else.
Let's try to make a good Matlab easter egg list because it seems that there isn't one.
What should be posted:
  • Unexpected but intentional behaviour
  • Special things that the programmers left for us to discover
  • Extra code inside a function that can be used for other purposes
  • Hidden pictures and audio clips
What shouldn't be posted:
  • Repeated Easter Eggs, if someone already posted it please don't repeat
  • Bugs in functions that cause trouble and might be fixed in later versions
  • Matlab games that come with the program unless they aren't mentioned in the documentation (the games are in the other demos, try the xpbombs and fifteen, you can even see the code for both games)
Don't be shy, what was your matlab learning curve, how many years or months, what were the difficulties to begin with.
I think that the answers would be most valuable for new users, maybe you can also tell us the tricks that allowed you to master some parts or all matlab.
Now it's your turn...
Jan
Jan
Last activity 2024-9-20,14:44

Which Matlab related forums and newsgroups do you use beside MATLAB Answers? Which languages do they use? Which advantages and unique features do they have?
Do you think that these forums complement or compete against MathWorks and its communication platform?
Actually all answers are accepted.
O.k., admit it. Who has done this (or something that resulted in the same loss of info) before?
>> laster
??? Undefined function or variable 'laster'.
>> lasterr
ans =
Undefined function or variable 'laster'.
D'Oh! I need a ERRORBEFORELASTERR function.
What's one of your dumb MATLAB mistakes?
Are there parts of MATLAB that could disappear as far as you were concerned, things you don't need or which were "bad ideas" or which cause more trouble than they are worth in your experience?
One suggestion per answer please, so we can see how other people feel about the same matters.
I use MATLAB most days (when I'm at work!). It makes my life easier, for many reasons, which is why I like it.
What are the reasons you like it (assuming you do), and why?
I love MATLAB. It is so quick and easy to write software to do what you want. It has excellent debugging and profiling tools. It is cross platform, making code easy to share (assuming the other people have forked out for the not-so-cheap license). It has interfaces to other software.
However, there are some things about it that irk me. I'd like to hear from other people what things annoy them about MATLAB.
---------------------------------
Because this thread has become so large it is slow to load and navigate. Please post new answers in the second thread.
---------------------------------
What is the best way to learn MATLAB at home without a tutor?
As asked by Vieniava in "How to make a list of user's reputation?", some of us came up with interesting ideas on how to fill an updated list with the reputation scores of the contributors to Answers.
I took the initiative to compile a public list of users with meta info:
  • position (desc ordering by reputation)
  • id
  • nickname (truncated to fit the page)
  • reputation
  • # of comments
  • # of questions asked
  • % accept rate
  • # of posts answered
  • # of accepted answers
The code used to compile the list is available at the bottom.
EDIT
TMW team implemented a page with the metascores: http://www.mathworks.com/matlabcentral/answers/contributors
Please refer to it and congrats to the team!
Use this function to retrieve info from the link above:
function [metainfo, elapsedTime] = metainfo(type,order)
% METAINFO - Retrieve metainfo on contributors to www.matworks.com/.../answers
%
% METAINFO Retrieve data sorted by reputation in descending order
%
% METAINFO(TYPE,ORDER) Specify TYPE and sorting ORDER as
% type : 'reputation'
% 'questions'
% 'answered'
% 'accepted'
%
% order: 'asc'
% 'desc'
%
% Examples:
%
% % Standard call (rep, disc)
% info = metainfo;
%
% % Sort by question answered in descending order
% info = metainfo('an','d');
%
% See also: URLREAD, REGEXP
% Author: Oleg Komarov (oleg.komarov@hotmail.it)
% Tested on R14SP3 (7.1) and on R2009b. In-between compatibility is assumed.
% 28 feb 2011 - Created
tic
% Check # inputs
error(nargchk(0,2,nargin))
% Retrieve inputs
if nargin == 0
type = 'reputation';
order = 'desc';
end
if ~exist(type,'var')
sortTypes = {'reputation','questions','answered','accepted'};
type = sortTypes{strncmp(type,sortTypes,numel(type))};
order = 'desc';
end
if ~exist(order,'var')
orderTypes = {'asc','desc'};
type = orderTypes{strncmp(order,orderTypes,numel(order))};
end
% Build url string
url = ['http://www.mathworks.com/matlabcentral/answers/contributors?'...
'dir=' order '&sort=' type '&page='];
% First read
[page, ok] = urlread([url '1']);
% Catch number of pages to read
if ok
totcon = regexp(page,'>1 - 50 of (\d+)','tokens');
totcon = dataread('string',totcon{1}{1},'%d');
nPages = ceil(totcon/50);
else
error('Cannot read ".../contributors?page=1"')
end
% Loop over contributors pages
metainfo = cell(totcon,7);
metainfo(1:end,1) = num2cell(1:size(metainfo,1));
for p = 1:nPages
if ok
endpos = 50*p;
% Id, Rep
expr = '><a href="\/matlabcentral\/answers\/contributors\/(\d+)';
data = regexp(page, expr,'tokens');
if 50*p > totcon; endpos = 50*(p-1)+numel(data); end
metainfo(1+(p-1)*50:endpos,2) = [data{:}];
% Nickname
expr = ['"Reputation: (\d+)">([\w\ ' reshape([repmat(92,1,137);33:59,61:64,91:97,123:126,161:255],1,[]) ']+)</a></h2>'];
data = regexp(page, expr,'tokens');
metainfo(1+(p-1)*50:endpos,[4,3]) = cat(1,data{:});
% Qcount, Ans, Acc
data = regexp(page, '<span >(\d+)</span>[A-z<>"-\s\/]+','tokens');
metainfo(1+(p-1)*50:endpos,5:7) = reshape(cat(1,data{:}),3,[]).';
else
error('Metainfo import stopped. \nCannot read ".../contributors?page=%d"',p)
end
[page, ok] = urlread([url sprintf('%d',p+1)]);
end
% Convert to doubles
metainfo(:,[2,4:7]) = cellfun(@str2double,metainfo(:,[2,4:7]),'un',false);
elapsedTime = toc;