# TUTORIAL: how to format your question with markup

643 ビュー (過去 30 日間)
Oleg Komarov 2011 年 8 月 6 日

[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);
--------------------------------------------------------------------------------------------------------------------------------------
[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.
##### 14 件のコメント表示非表示 13 件の古いコメント
Walter Roberson 2018 年 4 月 16 日

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

### 回答 (8 件)

Oleg Komarov 2011 年 8 月 7 日
CODE
##### 4 件のコメント表示非表示 3 件の古いコメント
Stephen23 2018 年 6 月 12 日
@Trude Mashburn: I just checked your question, and none of the code text has been indented.
1. Select the code text
2. Click the {} Code button
3. Ensure that there is a trailing empty line
4. Check the formatting in the preview pane, make changes as required.
5. Click Submit to save the new formatting.
An alternative to using the {} Code button is to simply put two space characters at the start of each code line.

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

Oleg Komarov 2011 年 8 月 6 日
BOLDFACE
##### 1 件のコメント表示非表示 なし
Walter Roberson 2011 年 8 月 10 日
Note: the bold mode only works between pairs of * in the same paragraph. If you highlight several paragraphs (with empty lines between them) and click on the Bold button, although an * will be put on the first line and last line of the selection, the bold will "break" because of the empty lines.

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

Oleg Komarov 2011 年 8 月 6 日

ITALIC
##### 1 件のコメント表示非表示 なし
Walter Roberson 2011 年 8 月 10 日
Note: the italic mode only works between pairs of underscores in the same paragraph. If you highlight several paragraphs (with empty lines between them) and click on the Italic button, although an underscore will be put on the first line and last line of the selection, the italics will "break" because of the empty lines.

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

Oleg Komarov 2011 年 8 月 7 日
MONOSPACED
##### 1 件のコメント表示非表示 なし
Walter Roberson 2011 年 8 月 12 日
Note: the monospaced mode only works between pairs of bars in the same paragraph. If you highlight several paragraphs (with empty lines between them) and click on the monospace button, although an bar will be put on the first line and last line of the selection, the monospace will "break" because of the empty lines.

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

Oleg Komarov 2011 年 8 月 7 日
NUMBERED LIST
##### 3 件のコメント表示非表示 2 件の古いコメント
Walter Roberson 2011 年 8 月 12 日
Note: the numbering sequence restarts at each empty line, so do _not_ put blank lines between the portions.
Note: the # must be after a "real" line break, where carriage return was typed at the end of the previous line; it is not sufficient to put it at what looks like the beginning of a line, if the line has been automatically wrapped down from the previous line.

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

Oleg Komarov 2011 年 8 月 7 日
BULLETED LIST
##### 3 件のコメント表示非表示 2 件の古いコメント
Walter Roberson 2011 年 8 月 12 日
Note: the * must be after a "real" line break, where carriage return was typed at the end of the previous line; it is not sufficient to put it at what looks like the beginning of a line, if the line has been automatically wrapped down from the previous line.

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

Oleg Komarov 2011 年 8 月 7 日
##### 1 件のコメント表示非表示 なし
Walter Roberson 2011 年 8 月 7 日
Simple hyperlinks are not converted automatically by the site: that is being done by browsers.
Note: ensure that there is no whitespace space immediately after the < or immediately before the > or else the link will not be created.
Note: there must be whitespace (or beginning of line) immediately before the < or else the link will not be created. In particular, some people like to put links in brackets such as (<some link or other>) and that will not work because there must be a space before the < .

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

Image Analyst 2016 年 8 月 13 日

To insert an image into the body of your post, click this icon:
and either browse to a file on your computer, or specify a URL of an image on the web.
You might find it easy to use http://snag.gy. You can just type alt-PrintScreen (in Windows) to capture the active window into the clipboard. Then go to this web site and type control-v to paste it in. You can then crop if it you want. It gives you a URL that you can then paste into the URL field you see when you click the green and brown frame icon:
You can also use the paper clip icon to attach an image file to your post, but it will not be displayed. It will appear as a filename beneath your text. We would then have to right click that filename and save it to our computer, and then open the image in MATLAB or some other image file viewer. This is less convenient for readers because they can't see your picture immediately.
##### 6 件のコメント表示非表示 5 件の古いコメント
madhan ravi 2018 年 11 月 11 日
Thank you sir Image Analyst it turned out only jpg format can be viewed directly

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

### Community Treasure Hunt

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

Start Hunting!

Translated by