Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MATLAB syntax blocks in 'Testing a function' #257

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

warrickball
Copy link

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
```

Copy link

🆗 Pre-flight checks passed 😃

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant