How to create an array from an existing array and a table.

4 次查看(过去 30 天)
I've got a 4D array which contains the internal diameters of some bearings. I want to create a 4D array for the width of some lock nuts, I have a table of data for the locknuts and my intention was to create this array by going through my bearing array and finding the width of the locknut for that specific internal diamter of bearing. There are locknuts for every internal diameter of bearings, with the exception of certain elements of the array that have the internal diameter set to 0. Any help would be really appreciated, currently very stuck.
  2 个评论
Dyuman Joshi
Dyuman Joshi 2023-11-6
If I understand your question correctly, the approach seems to be comparing the data and use indexing. Fairly simple.
"my intention was to create this array by going through my bearing array and finding the width of the locknut for that specific internal diamter of bearing."
What have you implemented yet?
What is the data in the table?
What does the data in the 4D array represent? Individual values of internal diameters or something else?
daniel
daniel 2023-11-6
Sorry, for wasting your time, having spent several hours toiling over this, I finally cracked it. What i was trying to do was do some bearing selection for a bunch of different forces. The forces are varied by varying 3 different lengths, I created a 3D array which contained the values of all these forces. I had the data for the bearings in a table (281 different bearings) and I used BSXfun and some other stuff to check for each value of force in my 3D array whether the bearings in the table had a sufficient force rating. This created a 4D array with the 4th dimension being the index of the specific bearing. The elements in this array contained the internal diameters of the bearings, if the bearings couldn't meet the required force then the value was left at 0. I had another table of data for some lock nuts that i intended to use to secure the bearings in place. I wanted to create a 4D array identical in size to my bearing array, where the nonzero values in the array were the width of the relevant lock nut. I.e. if I had an internal diameter of 30mm stored in my 4D array, I would look up in my lock nut table the width of a lock nut that has an internal diameter of 30mm and store that in the same element of my new 4D array. Sorry for not being particularly clear with the question, and having wasted your time.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by