unique identifier for importing arrays.
2 次查看(过去 30 天)
显示 更早的评论
I am trying to create a unique identifier for a script. I bring in the file as csv, and make a variable out of it.
clc, clear all
A = csvread('Cutlist.csv')
S_A= size(A)
iter=10000
iter_f = iter+ size(A)
iterf = iter_f(1,1)
i = (iter:iterf)'
This way seems inefficient, and doesn't fully address the issue. The A vector (1344*1) are stick lengths. My final script needs to account for many different kinds, colors, cuts, types for those sticks.
So the end result that I am seeking for good data should be something like
Pl_id(10000) % First Stick Element.
Pl_id(11344) % Last stick element of imported list, with n=number of elements, that will differ for each import.
Pl_id(%apply a custom identifier for each stick).
but i've read everyone say not to do such iteration on forums. I read deep into HDF5 thing, and would like to implement that. But I am all confused how i would do that. My structure needs an index/identifier>to take data from excel, and send it back to the external software.
Pl_id. %some structure you can advice implementing.
& it needs to be able to respond to other variables shown in picture. After a stick is processed, I would like to discard/eliminate making the remaining dataset smaller iteratively.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/193997/image.png)
<<
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/193998/image.png)
>>
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/193999/image.png)
I have attached the picture of cutlist string I used,then point from where I picked the data, and the last file shows a sample data file that is used in our fabrication equipment's software. I am trying to build a new optimizer for efficient use of lineal material.
2 个评论
Image Analyst
2018-8-17
You've probably delayed a good response by forgetting to attach the text 'Cutlist.csv' file.
And you say you want "to take data from excel" (whatever that means) but forgot to attach the Excel workbook, or attach your xlsread() code or ActiveX code, depending on what you're wanting and how you're doing it.
And after an item is processed, why do you want to remove/delete it from the dataset? Normally when people index along an array and do things with the values, they don't delete that element/member from the array, making it shorter. Why do you think you need to do that?
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!