Issues with inputdlg and calling values from the matrix?

I'm having a weird issue that I can't seen to figure out. I'm using inputdlg to input values that I'll later call and subtract from another value. Since inputdlg saves as a cell array, I converted it to a matrix which allows me to call forth a specific value from it to use later. I've verified that my input values are all saved to that correctly. However, when I run this part of the code, the data gets shifted a weird amount (it's like 50-55), even when the input for that shift is 0. Basically, it's running into an issue with the simple matrix subtraction. That when I tell it to subtract one of the saved matrix values from a previously calculated value (from my collected data set), it subtracts something else.
Here's my code, any input at all will be greatly appreciated. I'm at a complete loss.
prompt = {'Left Fx','Right Fx','Left Fy','Right Fy','Left Fz:','Right Fz'}; dlg_title = 'Offset Force Values'; num_lines = 1; def = {'0','0','0','0','0','0'}; options.Resize='on'; result = inputdlg(prompt,dlg_title,num_lines,def,options); offset = cell2mat(result); ffLeftFx=fLeftFx-offset(1); ffRightFx=fRightFx-offset(2); ffLeftFy=fLeftFy-offset(3); ffRightFy=fRightFy-offset(4); ffLeftFz=fLeftFz-offset(5); ffRightFz=fRightFz-offset(6);

Answers (0)

Categories

Asked:

on 12 Feb 2015

Community Treasure Hunt

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

Start Hunting!