Error using Xls write

9 views (last 30 days)
pepsodent
pepsodent on 30 Oct 2015
Edited: pepsodent on 30 Oct 2015
Error using xlswrite (line 219) Invoke Error, Dispatch Exception: Source: Microsoft Excel Description: Microsoft Excel cannot access the file 'C:\Program Files\MATLAB\MATLAB Production Server\R2015a\bin\7136D000'. There are several possible reasons:
• The file name or path does not exist. • The file is being used by another program. • The workbook you are trying to save has the same name as a currently open workbook.
This is my code :
clear all clc n=input('Enter the number of cases do you want to analyze : ' ); for num = 1 : n [u1,u2,u3,t,dx,dt,a,x]=inputdata; if num==1 figure plot(u1(:,1),'k'); xlabel(' \itX \rightarrow '); ylabel(' u(x,1)\rightarrow)'); end dt u1=firstupwind(t,dx,dt,a,x,u1,num); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function u1=firstupwind(t,dx,dt,a,x,u1,num)
c=a*dt/dx; if c>1 fprintf('c=%g, Enter another Courant Number\n',c); return else for i=1:int32(t/dt) for j=2:x-1 u1(j,i+1)=u1(j,i)-c*(u1(j,i)-u1(j-1,i)); end end end
filename='firstupwind.xlsx'; sheet= num; xlswrite(filename,u1(:,[1 t/(dt*6)+1 t/(dt*3)+1 t/(dt*2)+1 (2*t)/(dt*3)+1 (5*t)/(dt*6)+1 t/dt+1]),sheet,'B3'); figure surf(u1);

Answers (0)

Categories

Find more on App Building in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!