Wolfram Computation Meets Knowledge

What can I do to minimize my code when I am looking for help with an issue?

When asking for help with a coding problem, it is important to include only the essential parts of the code to ensure your audience is able to immediately understand the issue.

Leave out the unnecessary parts of your code

For example, if you were having a problem with your Plot command:

Plot[{Cos[x], Sin[x]}, {x, 0, 10}, Filling -> Bottom, Frame -> True, FrameTicks -> All, Axes -> False, PlotLabel -> "Sin and Cos Plotted"]

Removing options that are not essential to the behavior can help focus the issue. If the problem involved the option "PlotLabel", reduce the code to:

Plot[{Cos[x], Sin[x]}, {x, 0, 10}, PlotLabel -> "Sin and Cos Plotted"]

If you are not sure which options are relevant, try removing the options one at a time until the issue is no longer present. This will help indicate which options are relevant to the issue.

Minimize the content that the example relies on

For example, if your issue relies on data from a larger CSV file:

data = Import["largefile.csv"];
ListPlot[data]

See if you can reproduce the problem with a small representative data set:

data = {{1, 2}, {2, 3}, {3, 4}, {4, 5}};
ListPlot[data]


Ensure that your code is self-contained

To test that your code is not relying on any further variable or symbol definitions that need to be included, quit and restart the kernel, and then rerun the code.

For example, sending the following Plot command without the definition for fn would be difficult for someone to troubleshoot:

Plot[fn[x], {x, 0, 10}]

Make sure all functions are defined, or see if the issue is present without using any user-defined functions:

Plot[x^3 + Cos[x], {x, 0, 10}]


この項目は役に立ちましたか?
はい
いいえ

ご意見・ご提案がおありでしたらお書きください.

フィードバックをありがとうございました.

送信

サポートへのお問合せ

お支払い,アクティベーションに関する質問から技術的な質問まで,お気軽にお問い合せください.

販売代理店 (ライセンスをお持ちの方は、ご購入された代理店にお問い合わせください)

Hulinks

電話:03-5642-8380
Fax:03-5642-8381

soft.sales@hulinks.co.jp
Webサイト

日本電子計算株式会社

電話:03-5210-0184
Fax:03-5210-0229

math_info@cm.jip.co.jp
Webサイト

亘香通商株式会社

電話:045-320-2711
Fax:045-320-9342

sales@senko-corp.co.jp
Webサイト

株式会社シーエムディーラボ

電話:03-3408-8406
Fax:03-3408-8406

info@cmdlab.co.jp
Webサイト