Here's a simple script in MATLAB that can be used to calculate component A based on the known percentage of component B:
main.m265 chars9 lines
In this script, we first ask the user to input the percentage of component B. We then use that input to calculate the percentage of component A, which is simply 100% minus the total percentage of components B and C. Finally, we use fprintf
to display the result to the user.
Note that this script assumes that component C is always 1%, as stated in the question. If this value changes, the script would need to be modified accordingly.
gistlibby LogSnag