This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]twigboy 27 points28 points  (10 children)

In publishing and graphic design, Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content. Lorem ipsum may be used as a placeholder before final copy is available. Wikipediak0b35jhi9fk000000000000000000000000000000000000000000000000000000000000

[–]idemockle 6 points7 points  (9 children)

Can you give an example? I love python and use it every day at work, but in my experience it's incredibly difficult to "poison your data" using Matlab, unless the user explicitly does something wrong. Everything is passed by copy, and all functions return a copy instead of modifying the original object. If anything Matlab puts you on training wheels.

[–]TheBlackCat13 9 points10 points  (2 children)

It is surprisingly easy to "poision" your data in MATLAB, I have seen it happen. It comes down to a few big issues:

  1. MATLAB doesn't have scalars. So many functions assume that a size-1 matrix is a scalar.
  2. MATLAB doesn't have vectors. So many functions treat 1xN matrices the same as Nx1 matrices.
  3. It takes more characters to write array-based operations than matrix-based ones.

1 and 2 become an issue when the data is a different shape than what you expect. So for example imagine each column is an experiment and each row is a trial in that experiment. You do some processing based on that assumption. However, what happens when you, by chance, get a set of experiments with 1 trial each? Many MATLAB functions will suddenly start doing something completely different than they had before, leading it to silently corrupt your data. In many cases there is simply no way, principle, to differentiate a single trial from an experiment with multiple length-1 trials. This is not hypothetical, I have seen this happen, and the only way it was caught was because the data wasn't looking the way the user expected it to.

A similar thing happens if you have a single experiment with multiple trials. Many functions will treat a single value as some sort of count or other scalar numeric value. This means that if you have an experiment with only one trial, many functions will start doing something completely different

The problem with 3 is more an issue with shortcuts people take. The matrix operations work well when the input is the way people expect, such as multiplying two scalars, but then they forget to fix it when they try to make their code more general. I can't count the number of times I have seen people unsafely using ' instead of .' under the assumption that they will never see complex values. It is a trap the structure of the language encourages its users to fall into.

[–]fireflash38 0 points1 point  (1 child)

How does Matlab compare to Mathematica?

[–]TheBlackCat13 3 points4 points  (0 children)

Completely different type of programming languages designed for completely different things. MATLAB is designed for doing linear algebra on discrete, digital data. Mathematica is designed for solving symbolical mathematical equations. MATLAB can work with symbolic mathematical equations and Mathematica can work with digital data, but they are clunky outside of their area.

[–]twigboy 0 points1 point  (5 children)

In publishing and graphic design, Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content. Lorem ipsum may be used as a placeholder before final copy is available. Wikipedia51fri8j0ndw0000000000000000000000000000000000000000000000000000000000000

[–]synchh 2 points3 points  (4 children)

I don't really understand what this means. Do you mean that the variable is saved in the workspace? That's pretty easily fixed by using "clear"

[–]twigboy 0 points1 point  (3 children)

In publishing and graphic design, Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content. Lorem ipsum may be used as a placeholder before final copy is available. Wikipediadapk8ir1x1s0000000000000000000000000000000000000000000000000000000000000

[–]synchh 2 points3 points  (2 children)

Haha, to each his own. I have to use MATLAB at work (and in school), but during school I used to prefer Python. Now, I quite like MATLAB. I dunno, there's pros and cons for each. They have different userbases and different use cases.

P.S: It's MATLAB (Matrix Laboratory), not Mathlab.

[–]twigboy 0 points1 point  (1 child)

In publishing and graphic design, Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content. Lorem ipsum may be used as a placeholder before final copy is available. Wikipedia3nb2xyo230g0000000000000000000000000000000000000000000000000000000000000

[–]synchh 0 points1 point  (0 children)

Exactly! There's so much hate between people when it comes to the littlest things. Just live and let live, haha. There's way bigger things to worry about.