matlab-novice-inflammation icon indicating copy to clipboard operation
matlab-novice-inflammation copied to clipboard

Fix MATLAB syntax blocks in 'Testing a function'

Open warrickball opened this issue 1 year ago • 1 comments

I found two solutions under Testing a function that were being rendered as:

```
function out = normalise(in)
    %NORMALISE   Return original array, normalised so that the
    %            new values lie in the range 0 to 1.

    H = max(max(in));
    L = min(min(in));
    out = (in-L)/(H-L);
end
```
{: .language-matlab}

and

```
a = linspace(1, 10);   % Create evenly-spaced vector
norm_a = normalise(a); % Normalise vector
plot(a, norm_a)        % Visually check normalisation
```
{: .language-matlab}

I suspect these are from the old style (pre-Workbench) lessons, so I mimicked the syntax used elsewhere for MATLABL function blocks, i.e.

```matlab
% code here
```

warrickball avatar Nov 14 '23 11:11 warrickball

:ok: Pre-flight checks passed :smiley:

This pull request has been checked and contains no modified workflow files, spoofing, or invalid commits.

It should be safe to Approve and Run the workflows that need maintainer approval.

github-actions[bot] avatar Nov 14 '23 11:11 github-actions[bot]