• ¡Welcome to Square Theme!
  • This news are in header template.
  • Please ignore this message.
مهمان عزیز خوش‌آمدید. ورود عضــویت


امتیاز موضوع:
  • 24 رای - 2.42 میانگین
  • 1
  • 2
  • 3
  • 4
  • 5
Title: نحوه نوشتن خروجی مطلب در اکسل و برعکس
حالت موضوعی
#1
درود
در سورس های یر یاد میگیرید چگونه خروجی مطلب رو در اکسل وارد کنید و بر عکس در مطلب خروجی اکسل رو وارد کنید !
اولین سورس کد :
Write to Excel Sheet through Matlab

.zip   Write to Excel Sheet through Matlab(www.parsicoders.com).zip (اندازه 8.22 KB / تعداد دانلود: 487)
یک مقاله اموزشی در مبحث نوشتن و خواندن در اکسل و مطلب توضیحاتی داده است:

.rar   Simulink_importing_exporting_to_excel(www.parsicoders.com).rar (اندازه 194.21 KB / تعداد دانلود: 501)
در این مبحث هم به وارد کردن یک فایل اسکل به مطلب رو یاد میگرید.
بسیار ساده هست شما xlsread در مطلب به راحتی میتونید از اکسل بخوانید.
توضیحات بیشتر:Instructions
    • 1Type the following command into the MATLAB Command Window to import the numeric contents of the Excel file "data.xls" to the MATLAB variable "exceldata:"exceldata = xlsread('data.xls');Just as with ".m" files, MATLAB's default directory is the "MATLAB" folder in your "My Documents" directory. If the Excel file is stored elsewhere, specify its full path. For example:exceldata = xlsread('c:\users\yourname\desktop\data.xls');
    • 2Pass a second argument to "xlsread" to specify which spreadsheet to import if the file has more than one. For example, to get the data from the second spreadsheet, type this:exceldata = xlsread('data.xls',2);If your spreadsheets are named within the file, use the name of the one you want in single quotations.
    •  
    • 3Try the following command to see if your system is capable of using the advanced functionality of "xlsread":exceldata = xlsread('data.xls',-1);If all goes well, Excel starts and MATLAB presents a dialog instructing you to select the data region you want in Excel. Do so, then click "OK" in the dialog to complete the "xlsread" command. If you receive an error saying that the Excel server could not be started, you can only use the simpler form of "xlsread."
    • 4Use the following syntax to import a range of data from the Excel spreadsheet:exceldata = xlsread('data.xls','A1Big Grin4');The range is specified using Excel's notation. Use "A:A" to get all of the first column and "ABig Grin" to get the first through fourth columns. Get a specific range of data from a certain spreadsheet in a file with a command like this:exceldata = xlsread('data.xls',2,'A:B');This command imports the first two columns of the second spreadsheet in the file.
 Tips & Warnings
  •  Use the "xlsfinfo" function to get information about an Excel file if you don't have Excel available to open it. Type "help xlsfinfo" for details about how to use it.


     
برای نوشتن در اکسل باید تابع xlswrite (این تابع مخصوص نوشتن خروجی مطلب در اکسل هست)
جزئیات بیشترHeartlswriteSyntax دستور: 
کد:
xlswrite(filename,A)
xlswrite(filename,A,sheet)
xlswrite(filename,A,xlRange)
xlswrite(filename,A,sheet,xlRange)

status = xlswrite(___)
[status,message] = xlswrite(___)
 
 توضیحات دستورات و نحوه کار کردن با ورودی و خروجی تابع ! 
کد:
Description

example

xlswrite(filename,A) writes array A to the first worksheet in Excel® file, filename, starting at cell A1.

xlswrite(filename,A,sheet) writes to the specified worksheet.

xlswrite(filename,A,xlRange) writes to the rectangular region specified by xlRange in the first worksheet of the file.

example

xlswrite(filename,A,sheet,xlRange) writes to the specified sheet and range, xlRange.

status = xlswrite(___) returns the status of the write operation, and can include any of the input arguments in previous syntaxes. When the operation is successful, status is 1. Otherwise, status is 0.

[status,message] = xlswrite(___) additionally returns any warning or error message generated by the write operation in structure message.
 یه مثال بیشتر
به فرض میخواهیم testdata.xlsx  در sheet 2 2 و در سل e1 یک مقدار تایم بنویسیم.
به این صورت : 

کد:
filename = 'testdata.xlsx'; A = {'Time','Temperature'; 12,98; 13,99; 14,97}; sheet = 2; xlRange = 'E1'; xlswrite(filename,A,sheet,xlRange)
 مثالی دیگر: 
کد:
Write a 7-element vector to an Excel file, testdata.xlsx.filename = 'testdata.xlsx'; A = [12.7, 5.02, -98, 63.9, 0, -.2, 56]; xlswrite(filename,A)
 
گروه دور همی پارسی کدرز
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg
 
پاسخ
#2
salam va ba arze hkaste nabashiad dar kode xlswrite maghadire tabe evalin chistba tashakor

 
 
پاسخ
#3
درود
لطفا پارسی تایپ کنید
تابع evalin اینجا توضح داده:
http://cens.ioc.ee/local/man/matlab/tech...valin.html
من کلا نفهمیدم منظورتون
گروه دور همی پارسی کدرز
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg
 
پاسخ
#4
(05-01-2013، 10:35 AM)Amin_Mansouri نوشته: درود
در سورس های یر یاد میگیرید چگونه خروجی مطلب رو در اکسل وارد کنید و بر عکس در مطلب خروجی اکسل رو وارد کنید !
اولین سورس کد :
Write to Excel Sheet through Matlab

یک مقاله اموزشی در مبحث نوشتن و خواندن در اکسل و مطلب توضیحاتی داده است:

در این مبحث هم به وارد کردن یک فایل اسکل به مطلب رو یاد میگرید.
بسیار ساده هست شما xlsread در مطلب به راحتی میتونید از اکسل بخوانید.
توضیحات بیشتر:Instructions
    • 1Type the following command into the MATLAB Command Window to import the numeric contents of the Excel file "data.xls" to the MATLAB variable "exceldata:"exceldata = xlsread('data.xls');Just as with ".m" files, MATLAB's default directory is the "MATLAB" folder in your "My Documents" directory. If the Excel file is stored elsewhere, specify its full path. For example:exceldata = xlsread('c:\users\yourname\desktop\data.xls');
    • 2Pass a second argument to "xlsread" to specify which spreadsheet to import if the file has more than one. For example, to get the data from the second spreadsheet, type this:exceldata = xlsread('data.xls',2);If your spreadsheets are named within the file, use the name of the one you want in single quotations.
    •  
    • 3Try the following command to see if your system is capable of using the advanced functionality of "xlsread":exceldata = xlsread('data.xls',-1);If all goes well, Excel starts and MATLAB presents a dialog instructing you to select the data region you want in Excel. Do so, then click "OK" in the dialog to complete the "xlsread" command. If you receive an error saying that the Excel server could not be started, you can only use the simpler form of "xlsread."
    • 4Use the following syntax to import a range of data from the Excel spreadsheet:exceldata = xlsread('data.xls','A1Big Grin4');The range is specified using Excel's notation. Use "A:A" to get all of the first column and "ABig Grin" to get the first through fourth columns. Get a specific range of data from a certain spreadsheet in a file with a command like this:exceldata = xlsread('data.xls',2,'A:B');This command imports the first two columns of the second spreadsheet in the file.
 Tips & Warnings
  •  Use the "xlsfinfo" function to get information about an Excel file if you don't have Excel available to open it. Type "help xlsfinfo" for details about how to use it.


     
برای نوشتن در اکسل باید تابع xlswrite (این تابع مخصوص نوشتن خروجی مطلب در اکسل هست)
جزئیات بیشترHeartlswriteSyntax دستور: 
کد:
xlswrite(filename,A)
xlswrite(filename,A,sheet)
xlswrite(filename,A,xlRange)
xlswrite(filename,A,sheet,xlRange)

status = xlswrite(___)
[status,message] = xlswrite(___)
 
 توضیحات دستورات و نحوه کار کردن با ورودی و خروجی تابع ! 
کد:
Description

example

xlswrite(filename,A) writes array A to the first worksheet in Excel® file, filename, starting at cell A1.

xlswrite(filename,A,sheet) writes to the specified worksheet.

xlswrite(filename,A,xlRange) writes to the rectangular region specified by xlRange in the first worksheet of the file.

example

xlswrite(filename,A,sheet,xlRange) writes to the specified sheet and range, xlRange.

status = xlswrite(___) returns the status of the write operation, and can include any of the input arguments in previous syntaxes. When the operation is successful, status is 1. Otherwise, status is 0.

[status,message] = xlswrite(___) additionally returns any warning or error message generated by the write operation in structure message.
 یه مثال بیشتر
به فرض میخواهیم testdata.xlsx  در sheet 2 2 و در سل e1 یک مقدار تایم بنویسیم.
به این صورت : 

کد:
filename = 'testdata.xlsx'; A = {'Time','Temperature'; 12,98; 13,99; 14,97}; sheet = 2; xlRange = 'E1'; xlswrite(filename,A,sheet,xlRange)
 مثالی دیگر: 
کد:
Write a 7-element vector to an Excel file, testdata.xlsx.filename = 'testdata.xlsx'; A = [12.7, 5.02, -98, 63.9, 0, -.2, 56]; xlswrite(filename,A)
 

سلام ممنون از مطلبتون
من متوجه نشدم الان یه فایل اکسل دارم که یکی از آرگومان های تابع فراخوانی شده تو برنامه اصلی ام است، حالا میخوام قبل فراخوانی این فایل اکسل را تعریف کنم ولی هر دستوری میزنم ارر میده.
لطفا بگید باید چی کار کنم؟
 
پاسخ
#5
سلام
برای اموزش به لینک زیر سر بزنید :
https://www.mathworks.com/help/matlab/ref/xlsread.html
گروه دور همی پارسی کدرز
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg
 
پاسخ
  


موضوعات مشابه ...
موضوع نویسنده پاسخ بازدید آخرین ارسال
  سورس زیر نحوه گرفتن سیگنال و کار کردن با جی پی اس (متلب) Amin_Mansouri 0 3,439 09-10-2012، 11:47 AM
آخرین ارسال: Amin_Mansouri

پرش به انجمن:


Browsing: 1 مهمان