Question: I keep getting the same error in MATLAB: Arrays have incompatible sizes for this operation. For the script below, specifically the equations FissE and SepE.

I keep getting the same error in MATLAB: "Arrays have incompatible sizes for this operation." For the script below, specifically the equations FissE and SepE. As far as I can tell, there is no incompatibility in "array" size. What is going wrong?
prompts ={'Enter Reactant 1/neutron mass (in amu):'; 'Enter Reactant 2 mass (in amu):'; 'Enter Product 1 mass (in amu):'; 'Enter Product 2 mass (in amu):'; 'Enter Product 3 mass (in amu):'; 'Enter original isotopic mass for separation calculation (in amu):'; 'Enter A-1 isotopic mass for separation calculation (in amu):'};
defaultValues ={'0','0','0','0','0','0','0'};
inputValues = inputdlg(prompts, 'Input', 1, defaultValues);
R1= inputValues{1};
R2= inputValues{2};
P1= inputValues{3};
P2= inputValues{4};
P3= inputValues{5};
SER = inputValues{6};
SER1= inputValues{7};
FissE =(R1+R2-P1-P2-P3)*931;
SepE =(1.008665+SER1-SER)*931;
disp('Calculated energy from fission event (in MeV):')
disp(FissE)
disp('Calculated separation energy (in MeV):')
disp(SepE)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!