Why is this error comming?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
2 Commenti
John D'Errico
il 14 Ott 2021
As is too often the case, someone has posted a picture of their code. Now, for someone to test out what you did, we need to type in evertything, with no errors on our part. And that will take care and a fair amount of time.
Instead, you could have paste in your data directly, whcih would have taken fewer step on your part, and LESS time for you too. If you paste in text directly, then we can copy and paste it directly into MATLAB. ANd that would allow me to identify exactly what you did wrong in a few seconds.
So what you have done is to make it more difficult for someone to help you.
Is there a good reason why you want to make it more difficult to get help? Perhaps someone may bother to type in your code. Not me. Sorry.
Risposte (1)
Image Analyst
il 14 Ott 2021
We can't run an image. You should have posted your code as code.
It looks like A has 6 elements, whereas b has only 2 elements and needs 6.
8 Commenti
Image Analyst
il 14 Ott 2021
Looks like it expects A to have rows, more than 1. Right now it's a row vector with one row. You can change it into a column vector with 6 rows by doing
A = [-prot, fats]';
Using ' transposes the array changing it from a 6-column row vector into a 6-row column vector. Equivalent to
A = reshape(A, [], 1); % Make into a single column.
or
A = [-prot(:); fats(:)];
Vedere anche
Categorie
Scopri di più su Get Started with MATLAB in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!