lcm-proj / lcm

Lightweight Communications and Marshalling
GNU Lesser General Public License v2.1
944 stars 385 forks source link

Fix matlab tutorial #427

Closed danielcjacobs closed 1 year ago

danielcjacobs commented 1 year ago

There's a couple simple edits to the MATLAB tutorial in this PR:

  1. Nitpicky whitespace change so that tutorial and example match exactly
  2. use isempty instead of comparing length to 0
  3. fix bug in print statement so that string is printed
  4. Add a note on java versioning.

2-3 are applied both to the tutorial and to the example code in examples/matlab.

Regarding 4, is this note sufficient, or should we include instructions/links on how to check and/or change the java versions used by the user's system and MATLAB.

nosracd commented 1 year ago

is this note sufficient, or should we include instructions/links on how to check and/or change the java versions used by the user's system and MATLAB.

I'd say it's sufficient but more help would be better. For example:

It might make sense to move this advice up closer to the javac command instructions so we can prevent users from encountering failures rather than give advice on fixing them.

Last, if we end up with a very large note it may make sense to just leave it as part of the section or even its own subsection.

danielcjacobs commented 1 year ago

Updated note and moved it up in f6379b7d2612c13956c63593dac98536665e8200.

Including the commands javac -version to get the version of the java compiler and version -java inside the MATLAB prompt to get its version of java

Agreed, this is very useful.

Including advice on how to target an earlier version of java when compiling (--release for 1.9 and later and -source/-target for earlier versions)

Since MATLAB is bundled with 1.8 by default, and should be backwards compatible with JARs older than 1.8, I didn't include this as it was a confusing corner case IMO.

Last, if we end up with a very large note it may make sense to just leave it as part of the section or even its own subsection.

That's fair. I think as-is it's just small enough to be a note. If we added any more details, I would maybe just add a new subsection to java-notes and link the subsection in this note.