Output file for standalone app doesn't work on MAC

2 views (last 30 days)
I am making a standalone application in Matlab. I am using the deploytool command to help me package and create the app. The basic idea is to run a program, get output, and then put that output into a csv file. When I do it on my pc, for other pcs then everything works great. When I do it on a mac, for macs everything works, except the output file doesn't work/isn't created. I don't need it to be a csv file, I just want the output file to work on both systems. I have attached my build file code (this is the output file). The analysis file is much too long. I'm not sure that it has anything to do with the output file function, but rather how I'm making the standalone app on a mac. Thanks in advance!
function []= buildJump(dx,xInrun,yInrun,xLanding,yLanding,xPs,yPs,xBuildTrIn2To,xBuildSS2TrOut,xTranOut,yTranOut,variables)
height_Inrun=zeros(1,length(xBuildTrIn2To));
for i=1:length(xBuildTrIn2To)
x = xBuildTrIn2To(i);
yP_i = interp1(xPs, yPs, x);% y component of parent surface
% yL_i = interp1(xLanding, yLanding, x);
% yI_i = interp1(xInr, yInr, x);
yI_i = interp1(xInrun, yInrun, x);
height_Inrun(i) = (yI_i-yP_i);
end
height_SS2TrOut=zeros(1,length(xBuildSS2TrOut));
for i=1:length(xBuildSS2TrOut)
x = xBuildSS2TrOut(i);
yP_i = interp1(xPs, yPs, x);% y component of parent surface
if x<xTranOut(1)
% snow budget data for landing surface
yL_i = interp1(xLanding, yLanding, x);
height_SS2TrOut(i) = (yL_i-yP_i); % rectangle of snow with area ydelta*dx
else
yT_i = interp1(xTranOut, yTranOut, x);
height_SS2TrOut(i) = (yT_i-yP_i); % rectangle of snow with area ydelta*dx
end
end
height=[height_Inrun, height_SS2TrOut];
xBuild=[xBuildTrIn2To,xBuildSS2TrOut];% horizantal
track = 0.000001:dx:length(xBuild); % I'm tricking the program to add decimal places
if length(xBuild)~= length(height)
fprintf('Error height and x vectors not the same size')
else
info={'VARIABLES','','BUILD INFO','Distance Along Slope Beginning at Transition In','Corrosponding X-axis Coordinates form Graph', 'Height of Jump'};
for i=1:length(xBuild)
info{i+1,4}=track(i);
info{i+1,5}=xBuild(i);
info{i+1,6}=height(i);
end
[rows,cols]=size(variables);
for i=1:rows
info{i+1,1}=variables{i,1};
info{i+1,2}=variables{i,2};
end
fid=fopen('buildJump.csv','wt');
[rows,cols]=size(info);
for i=1:rows
if i==1
fprintf(fid,'%s,',info{i,1:end-1});
fprintf(fid,'%s\n',info{i,end});
else
fprintf(fid, '%s,', info{i,1});
fprintf(fid,'%d,', info{i,2:end-1});
fprintf(fid,'%d\n', info{i,end});
end
end
fclose('all');
end
end

Answers (0)

Community Treasure Hunt

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

Start Hunting!