whats wrong with this function?

Hi!
I just get blank anwers when I run this function, cant understand whts wrong with this function, it gives me just [ ] as my answers..
Does anybody know what the error could be?:)

Antworten (1)

Jan
Jan am 4 Mär. 2022

0 Stimmen

Which inputs are you using? If e.g. best_salt_1 is not one of the options of the first switch block, the output of [] is expected.
The best way to examine such problems by your own is the debugger. Set a breakpoint in the first line of this function by clicking on the box left beside the text in the editor. Then step through the code line by line.
By the way, the names of your function and variables are extremely exhaustive. Programming allows to apply a more abstract view on the problem, so you can use the same function for a set of problems. Then "beregn_ionic_strength_best_salts_CaCl2_MgCl2_NH4l" is a cruel name of a function.

4 Kommentare

Muazma Ali
Muazma Ali am 4 Mär. 2022
I was wondering whether I have forgotten '. ' somewhere ..?
Jan
Jan am 4 Mär. 2022
As long, as we do not know, what you use as input, we cannot find out, if there is a problem with an elementwise multiplication.
Muazma Ali
Muazma Ali am 4 Mär. 2022
best_salt_1 can be one of the three salts (CaCl2, MgCl2 og NH4Cl ) and maks_vektprosent are weightpercentages for instance 35.0 or 25.
Muazma Ali
Muazma Ali am 4 Mär. 2022
I found the error, it was in another function, :)

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Programming finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 4 Mär. 2022

Kommentiert:

am 4 Mär. 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by