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

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

warrickball
Copy link
Contributor

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.

@dc2917 dc2917 self-requested a review January 6, 2025 15:48
Copy link
Contributor

@dc2917 dc2917 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR @warrickball. I've checked the build locally and this renders the blocks correctly.

@dc2917 dc2917 merged commit 4957340 into swcarpentry:main Jan 7, 2025
github-actions bot pushed a commit that referenced this pull request Jan 7, 2025
Auto-generated via `{sandpaper}`
Source  : 4957340
Branch  : main
Author  : Dan Cummins <[email protected]>
Time    : 2025-01-07 10:49:12 +0000
Message : Merge pull request #257 from warrickball/patch-1

Fix MATLAB syntax blocks in 'Testing a function'
github-actions bot pushed a commit that referenced this pull request Jan 7, 2025
Auto-generated via `{sandpaper}`
Source  : 3d130ce
Branch  : md-outputs
Author  : GitHub Actions <[email protected]>
Time    : 2025-01-07 10:49:51 +0000
Message : markdown source builds

Auto-generated via `{sandpaper}`
Source  : 4957340
Branch  : main
Author  : Dan Cummins <[email protected]>
Time    : 2025-01-07 10:49:12 +0000
Message : Merge pull request #257 from warrickball/patch-1

Fix MATLAB syntax blocks in 'Testing a function'
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.

2 participants