Format prompts for code generation

One thing about SpellBox is that you do not need to format the prompt in a specific manner. Simply be coherent and you should have a decent code.

Also, be sure to follow the following:

  • Use simple and direct language. Just insert what you need.

  • Clearly state the information you are looking for

  • Provide any necessary context or background information

  • Use proper grammar

Example:

get magnitude of a vector

Produces:

% Define vector
v = [1, 2, 3];

% Calculate magnitude of vector
mag = sqrt(sum(v.^2));
% or use the built-in function norm(v)
mag = norm(v);

Last updated