Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Java in General
Assign 1D to 3D in java
nvayin agha
Greenhorn
Posts: 16
posted 7 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I have an issue with
Java
programming.
In Matlab, we can assign:
d1(:,c,p)=d2;
Where d2 is one dimention.
How can we do this assignment in java ?
Stephan van Hulst
Saloon Keeper
Posts: 15510
363
posted 7 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You can't. Java doesn't have multi-dimensional arrays. Java only has arrays of arrays.
If you have an
int[][][] d1
, then the solution is to iterate over
i
in a loop and set
d1[i][c][p] = d2[i]
.
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Combining matlab and java
Double Boolean Operations
Problem with a static method in a class
Doubt in Multi D Array-Qs 12 Pg 49, K&B
Sibling assignment
More...