Search code, repositories, users, issues, pull requests...

Provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

Here are 89 public repositories matching this topic...

Zerodaytea / codehs-nitro-solutions.

My solutions for the CodeHS Nitro track that were required to be completed for my AP Computer Science Course. Some of these solutions are not ideal and were done very quickly simply to get the assignments over and done with so make sure to review the code and maybe even improve it before using it.

  • Updated Sep 11, 2021

ricky8k / APCSA-ProjectStem

Source code for the 2022-23 AP Computer Science A course on Project Stem.

  • Updated Jan 13, 2024

mapoztate / apcsa2020

Answer key for APCSA Edhesive 2020 - learn from example, don't plagarize.

  • Updated Apr 29, 2021

joshkmartinez / AP-CS-A

A stash of all the things I used in the AP CS A course

  • Updated May 28, 2019

ari-dixit / apcsa

A place to store my previous work for AP Computer Science. Attempt to solve on your own first before utilizing this as a resource to help you.

  • Updated Oct 9, 2023

chlohal / dinner-coding-time

AP Comp Sci homework helper

  • Updated Jun 11, 2023

kayleyseow / Picture-Lab

In this lab you will be writing methods that modify digital pictures. In writing these methods you will learn how to traverse a two-dimensional array of integers or objects. You will also be introduced to nested loops, binary numbers, interfaces, and inheritance.

  • Updated Jan 16, 2020

thatrobotdev / AP-CSA

All of my work for AP CSA

  • Updated Nov 20, 2021

exoad / ap-compsci-a

Visit the crunch sheet here: https://exoad.github.io/ap-compsci-a/

  • Updated Jun 1, 2022

ArsiaC01 / Java-Methods-Programs-AP-Comp-A-2021-2022

Selected programs from Java Methods Object Oriented programming and Data Structures textbook, from Mr. Tenzca's AP Computer Science A class (2021-2022). Benevolently provided for the benefit of confused students 😝.

  • Updated Jan 8, 2024

Kevin-Kwan / codingbat

Repository of my own iterations/answers to the CodingBat exercises.

  • Updated Jan 9, 2024

sollywollyson / Edhesive-AP-Comp-Sci-Term-1

Lessons 1-37

  • Updated Dec 2, 2019

developerjeffreywong / APCSMineSweeper

This version of MineSweeper is an AP Computer Science A lab

  • Updated Jan 29, 2019

BobSaidHi / CodeHSAPCSAUsefulFiles

Useful files I made/borrowed for APCSA on CodeHS.

  • Updated Apr 28, 2021

mitchwag / AP-Computer-Science

All Coursework from AP Computer Science A at Pennridge High School

  • Updated Jan 22, 2020

kudonon / AdventureGame

A basic text based adventure game using Java and GUI

  • Updated Sep 9, 2019

rogerjaffe / search-and-sort

  • Updated Mar 19, 2021

JohnLins / APCSA

My APCSA code, learning how to build algorithms with OOP

  • Updated Apr 21, 2021

hershyz / apcsa-problemset

Comprehensive, holistic FRQ problemset for the AP Computer Science-A Exam

  • Updated Apr 8, 2021

aryanmhaskar / SamplingDistributionWebsite

A statistics social-media website that allows users to upload input Excel files and see the distribution of their data.

  • Updated Jun 3, 2022

Improve this page

Add a description, image, and links to the apcsa topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the apcsa topic, visit your repo's landing page and select "manage topics."

pep

Find what you need to study

Unit 8 Overview: 2D Array

5 min read • november 15, 2020

Athena_Codes

Athena_Codes

The Big Takeaway From this Unit

Unit overview.

Exam Weighting

7.5-10% of the test

Roughly 3 to 4 multiple-choice questions

Always FRQ #4 , which tests your ability to make, traverse, and create algorithms with a 2D array .

Enduring Understanding

In the past two units, you've learned how to store data in an array or an ArrayList . Now it's time to take it to another dimension with 2D arrays . You can either think of them as a grid or as a nested array , and we'll use both methods of thinking in this unit. Using these, we'll learn how to set these up and also how to traverse them.

Building Computational Thinking

For this unit, we will first learn how to create and initialize 2D arrays with various types of objects. These will be nested arrays. When traversing a list, you need to use nested arrays for loops, and these will need to have proper bounds to avoid an ArrayIndexOutOfBoundsException . If you can master 2D arrays , you can easily do 3D and higher-dimensional arrays if you ever decide to continue using Java after this course!

Main Ideas for This Unit

Initializing 2D Arrays

Representations of 2D Arrays

Traversing 2D Arrays

2D Array Algorithms

8.1: 2D Arrays

We can declare and initialize a 2D array in much the same form as a regular array , but with some subtle differences. However, there are still two ways to do so. We can initialize an empty 2D array that fills the array with the same "null"/initialized values as when we use the regular arrays from Unit 6 (also called 1D arrays ). However, this only works for "rectangular" arrays , where the two dimensions are clearly defined. We will talk more about this in the next subsection.

Here is how to do this:

/* Template: type[][] twoDArrayName = new type[firstDimension][secondDimension] */ int[][] arrayA = new int[3][4];

You can also initialize this with a pre-existing 2D array . This is similar to how you do 1D arrays.

Here is an example of an int[3][4] 2D array but with values pre-initialized:

int[][] arrayB = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}};

You don't have to use integers for the type stored in the array . You can use any other primitive or reference type! Integers are only used in this guide for simplicity.

Representing 2D Arrays

The 2D arrays can be represented in 2 major ways: one that is more visual, and one that is closer to how it is stored in the memory.

Memory Representation

The first way to think about this is how it is stored in memory, or in terms of data structures. A 2D array in this form is just a nested array . There is an outer array having arrays for its individual terms. In each inner array , the terms are objects or primitive type values of the type stated during initialization. When we initialize an array of type[firstDimension][secondDimension], we are actually initializing an array of length firstDimension (remember to use length instead of size as size is only for ArrayLists as in Unit 7). Each item in this array is another array containing secondDimension items of the specified type. For example, arrayA is an array with 3 items, each of which is an array with 4 integers.

A 2D array does not have to be rectangular. The inner arrays can vary in size. Here is an example of a non-rectangular array :

int[][] arrayC = {{1, 2}, {3}, {4, 5, 6}};

However, for the rest of this unit, we will be concerned with rectangular arrays, as those will be the type tested on the AP Exam.

Graphical Representation (only works for rectangular arrays)

For rectangular arrays, we can think of these as a grid , table, or matrix (if you have learned them in a prior math class). We can express arrayB from earlier as follows:

For a 2D array , type [firstDimension][secondDimension] . In this representation, firstDimension is the number of rows and secondDimension is the number of columns. Remember that arrayB is an example of an int[3][4] 2D array . Using the same logic, arrayB has 3 rows and 4 columns.

From this visual idea, we can easily find the indices to access an individual element of a 2D array .

Indices for Elements in an int[3][4] Array

For indices, we use 2 bracketed numbers, called double-index notation , with the first being the row and the second being the column. Remember that Java is a 0-indexed language , so the row indices range from [0, 1, 2, ..., firstDimension - 1] and the column indices range from [0, 1, 2, ..., firstDimension - 1] .

For a pre-initialized array , the number of rows is the length of the outer array , which is arrayName. length , while the number of columns is the length of each inner array , which for rectangular arrays is arrayName[0]. length .

With double-index notation , we can access any element of the array . However, if you use an index that is not in the allowed range, you get an ArrayIndexOutOfBoundsException . For example, for arrayB, saying arrayB[2][3] means that we want the element in the third row and the fourth column, which corresponds to 12. Lets do a little practice using arrayB from above:

What are the indices for the following: 1. 6 2. 4 3. 9 4. 5 What values are given for the following indices: 5. [1][3] 6. [0][2] 7. [3][2] 8. [2][0]

1. [1][1] (2nd row, 2nd column) 2. [0][3] (1st row, 4th column) 3. [2][0] (3rd row, 1st column) 4. [1][0] (2nd row, 1st column) 5. 8 (2nd row, 4th column) 6. 3 (1st row, 3rd column) 7. The last row in the array has row index 2, since there is no fourth row with index 3, an ArrayIndexOutOfBoundsException is thrown 8. 9 (3rd row, 1st column)

We will use the graphical representation of 2D arrays in the rest of this unit as it is easier to visualize and understand.

Key Terms to Review ( 29 )

0-indexed language

ArrayIndexOutOfBoundsException

Double-index notation

Graphical Representation

Initialize 2D Arrays

Inner Array

Key Term: Practice with Indices and Values

Multiple-choice Questions

Nested Array

Nested For Loops

Non-rectangular Array

Outer Array

Primitive Type Values

Fiveable

Stay Connected

© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.

project stem assignment 9 2d arrays

# Unit 6: Array

# lesson 1: one-dimensional arrays, # lesson 2: traversing an array, # lesson 3: arrays of strings, # lesson 4: algorithms on arrays, # lesson 5: the enhanced for loop, # assignment 6: array statistics.

project stem assignment 9 2d arrays

  • Table of Contents
  • Course Home
  • Assignments
  • Peer Instruction (Instructor)
  • Peer Instruction (Student)
  • Change Course
  • Instructor's Page
  • Progress Page
  • Edit Profile
  • Change Password
  • Scratch ActiveCode
  • Scratch Activecode
  • Instructors Guide
  • About Runestone
  • Report A Problem
  • 8.1 Two-dimensional (2D) Arrays
  • 8.1.1 2D Arrays (Day 1)
  • 8.1.5 Set Value(s) in a 2D Array (Day 2)
  • 8.2 Traversing 2D Arrays (nested loops)
  • 8.2.1 Nested Loops for 2D Arrays (Day 1)
  • 8.2.5 Enhanced For-Each Loop for 2D Arrays (Day 2)
  • 8.3 2D Arrays Summary
  • 8.4 Mixed Up Code Practice
  • 8.5 Toggle Mixed Up or Write Code Practice
  • 8.6 Code Practice with 2D Arrays
  • 8.7 Free Response Questions
  • 8.7.1 Free Response - Gray Image A
  • 8.7.2 Free Response - Gray Image B
  • 8.7.3 Free Response - Route Cipher A
  • 8.7.4 Free Response - Route Cipher B
  • 8.8 Multiple-Choice Exercises
  • 8.8.1 Easier Multiple Choice Questions
  • 8.8.2 Medium Multiple Choice Questions
  • 8.8.3 Hard Multiple Choice Questions
  • 8.9 College Board Picture Lab and Steganography Lab for 2D Arrays
  • 8.9.1 Picture Lab A1 - A3
  • 8.9.2 Picture Lab A4: 2D Arrays in Java
  • 8.9.3 Picture Lab A5: Modifying a Picture
  • 8.9.4 Picture Lab A6: Mirroring Pictures
  • 8.9.5 Picture Lab A7: Mirroring Part of a Picture
  • 8.9.6 Picture Lab A8: Creating a Collage
  • 8.9.7 Picture Lab A9: Simple Edge Detection
  • 8.5. Toggle Mixed Up or Write Code Practice" data-toggle="tooltip">
  • 8.7. Free Response Questions' data-toggle="tooltip" >

8.6. Code Practice with 2D Arrays ¶

Replace the “ADD CODE HERE” below with the code to declare and create a 3 by 3 two-dimensional int array named table . The finished code will print the values 0 to 8.

Declaring and creating a 3 by 3 two-dimensional int array only takes one line. To declare the array specify the type of values in the array followed by [][] to indicate a 2D array and then provide a name for the array. To create the array add an = new , followed by the same type as before and [num rows][num cols] .

Replace the “ADD CODE HERE” below with the code to declare and initialize a two-dimensional String array called students with the names “Brice, Marvin, Anna” in the first row and “Kamal, Maria, Elissa” in the second. The finished code will print all the names in the array starting with all in the first row followed by all in the second row.

You can declare, create, and initialize a 3 by 3 two-dimensional String array on one line as shown below. Declare the array with type[][] name . Create and initialize an array with two rows and three columns using = { {item1, item2, item3}, {item4, item5, item6} }; . Be sure to separate the items with commas. Also separate the rows with a comma.

Print the values 47, 51, and 20 by accessing them in the given two-dimensional array.

Use arr[row][col] to get the value at a particular row and column. Remember that the index for the first row is 0 and the index for the first column is also 0.

Print the values 8, 3, 87, and 34 by accessing them from the given two-dimensional array.

Print the number of rows in the given two-dimensional array, or the length of the outer array. Then print the number of columns, or the length of each inner array.

Ex. The array { {“hello”,”there”,”world”},{“how”,”are”,”you”} } should print:

To get the number of rows, or the length of the outer array, use arrayName.length . To get the number of columns, or the length of an inner array, use arrayName[0].length .

Loop through the given two-dimensional array, printing out the values in the first row followed by those in the second row and so on.

Create a loop that iterates through all of the outer arrays, or the rows using arrayName.length . Then iterate through the inner arrays, or columns, using arrayName[0].length .

Declare and create a two-dimensional array of strings named colors . Put the colors (“red”, “yellow”, “blue”) in the first row, and the colors (“orange”, “green”, “purple”) in the second row. Then print every value in the array.

Declare and initialize the array in one statement as shown below. Loop through the rows and columns and print each value.

Replace the “ADD CODE HERE” below with the code to count and print the number of 7’s that are in the 2d array. It should print 2.

Use a nested for loop to loop through all the elements in a 2d array. Initialize a count variable to zero before the loop, and every time there is a 7 at the current row and column, increment the count variable by 1.

Replace the “ADD CODE HERE” below with the code to print out the sum of the numbers in the second row of the “table” array. It should print 18.

Use a loop to find the sum of all of the values in the second row. Since we are only looping through one row, we do not need a nested for loop. Initialize the sum to 0 and then loop through each element in the second row and add it to the sum.

Replace the “ADD CODE HERE” below with the code to find the sum of the values on the diagonal from [0][0] to [num rows - 1][num rows - 1]. Print the sum. It should print 5.

Create a variable to hold the total and loop through the rows in the array. Each time through the loop add the value at [row][row] to the total. Print the total.

Replace the “ADD CODE HERE” below with the code to declare and create a two-dimensional array of integers numbers with the numbers (1,2,3) in the first row, and the numbers (4,5,6) in the second row. Then loop through the two-dimensional array, printing out the values in the first row followed by those in the second row.

Replace the “ADD CODE HERE” below with the code to declare and create a two-dimensional array of integers numbers with the numbers (1,2,3) in the first row, the numbers (4,5,6) in the second row, and the numbers (7,8,9) in the third row. Then loop through the two-dimensional array, printing out the values in the first row followed by those in the second row and so on.

Given the following array, replace the “ADD CODE HERE” below with 1 line of code to replace the word “purple” with “yellow” using the correct array location.

Use arr[row][col] = value; to set the value at a particular row and column. Remember the index of the first row is 0 and the index of the first column is also 0.

FAQ: 2D Arrays: Java - Declaration, Initialization, and Assignment

Community%20FAQs%20on%20Codecademy%20Exercises

This community-built FAQ covers the “Declaration, Initialization, and Assignment” exercise from the lesson “2D Arrays: Java”.

Paths and Courses This exercise can be found in the following Codecademy content:

FAQs on the exercise Declaration, Initialization, and Assignment

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply ( ) below. If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

reply

Need broader help or resources ? Head to # get-help and # community:tips-and-resources . If you are wanting feedback or inspiration for a project, check out # project .

Looking for motivation to keep learning? Join our wider discussions in # community

Learn more about how to use this guide.

Found a bug ? Report it online, or post in #community:Codecademy-Bug-Reporting

Have a question about your account or billing? Reach out to our customer support team !

None of the above? Find out where to ask other questions here !

1. Declare a 2D array of float values called floatTwoD .

Wow, wow! Codecademy should’ve first introduced me to the float datatype, I don’t know what that is!

public class Exercise2 { public static void main(String args) {

I’m stuck to the last exercise : " When no one is looking, you want to modify the game so 'O' wins. Replace the game board so that all X’s are O’s and all O’s are X’s. Do this in one line with initializer lists. Do not declare ticTacToe again."

Create a 2D char array called ticTacToe representing the provided tic-tac-toe board. Use the characters ‘X’, ‘O’, and ’ '. char ticTacToe = new char { {‘X’, ‘O’, ‘O’}, {‘O’, ‘X’, ’ '}, {‘X’, ’ ', ‘X’} };

When no one is looking, you want to modify the game to where you, ‘O’, wins the game. Replace the game board so that all X’s are O’s and all O’s are X’s. Do this in one line with initializer lists.

I keep having this error message " Did you overwrite the value of ticTacToe with a new 2D char array on a new line?"

What should I do ?

To preserve code formatting in forum posts, see: How do I format code in my posts?

I don’t see where you have replaced the X’s with O’s and vice versa. You created the ticTacToe array in Step 3. In Step 4, you are supposed to exchange the X’s and O’s. For Example {'O', 'X', ' '} from Step 3 will become {'X', 'O', ' '} in Step 4.

Simulating a Phased Array

Oct 11, 2021 • Nathan Kerns

Introduction

Phased arrays have always intrigued me, and building one is a project I’ve had in the back of my mind for a while now. Unfortunately, the complex math and physics that govern their operation is a bit beyond my understanding. So, I figured I’d start from the basics and try to build an understanding of them by writing a simple simulation in Python.

To write all the code for the simulation, I used a Google Colab notebook, which is functionally the same as a Jupyter notebook but saved in Google Drive and running on Google’s servers. I’ll attach the both the .ipynb Jupyter notebook file and a plain .py file at the end with all the necessary code. The only requirements to run them are recent versions of Python 3 (3.6 is the minimum because f-strings are used), numpy, and matplotlib. These are the versions Colab has installed by default at the time of writing, so they should be guaranteed to work:

What is a phased array?

To start off, we’ll talk about what a phased array actually is, what it does, and why you might use one. At the basic level, a phased array is just an array of antennas that are all sent the same signal, just phased shifted by different amounts. The phase shift can be changed to control the direction and width of the beam, so the array can be aimed without any moving parts. The interference pattern created by the phase differences changes strength and direction of the radiation pattern. One common application is radar, where moving a beam electronically rather than mechanically allows for faster scanning rates. The US military operates massive phased arrays tens of meters in diameter, initially built during the Cold War to detect nuclear missile and now primarily used to track satellites.

Simulation Setup

First, the required packages needed to be imported.

Then, we’ll set up a few parameters that define the simulation.

Here’s an explanation of what they all do:

  • t - Time in seconds. It’s not strictly necessary since we will be simulating only a single point in time, but it’s useful to understand which equations depend on time.
  • v - Velocity in meters/second. You might notice that this is the velocity of sound, not of radio waves. Sound is a lot easier to understand and work with than RF, so we’ll be sticking with it for now. The physics are mostly the same at the level of this simulation (as radio waves of the same wavelength), since we are just simulating a steady state.
  • f - Frequency in hertz.
  • w - Wavelength in meters.
  • k - Wavenumber in radians/meters. This is basically the number of wave cycles in a meter, but units of radians to make the dimensions work out.
  • N - Number of emitters (antennas, speakers, etc).
  • d - Distance between emitters in meters. This number, or specifically it’s relation to wavelength, can be modified to affect certain properties of the beam. A quarter wavelength is a good starting point for us.
  • omega - Angular velocity of the wave in radians/second. Essentially the same as frequency, just in different units.
  • dir - Direction of the beam in degrees. dir_rad is the same but in radians.
  • dphi - Phase offset in radians. Adjacent emitters will have their phases offset by this value. This is based on the following equation, taken from this article by Analog Devices: \(\Delta \Phi = \frac{2 \pi d \sin(\theta)}{\lambda}\)
  • dx - Simulation resolution in meters. Setting this to 1/10th of a wavelength ensures the waves will have enough resolution to calculate interference patterns.

Next, we set up a few more things that will be used in the simulation. First is an array holding the positions of the emitters. This places each emitter at distance d apart, centered at x = 0 .

The phase offsets of all the emitters are set up in a similar way. This could be done with np.arange() , but that doesn’t work when dphi = 0 , so list comprehension will have to do.

Finally, the simulation bounds are set using the far field equation, also taken from the Analog Devices article mentioned above.

\(\text{Far Field} > \frac{2 D^2}{\lambda}\) \(D = d(N-1)\)

That value is multiplied by 4, so we have a good chunk of far field to use, and rounded up. A minimum size of 1 meter is also set because things get weird at the small scale.

Now, we get to the interesting part. The next dozen or so lines do all the work to simulate the waves propagating through space and interfering each other. It might take a while to run, depending on your hardware, but with the current parameters it only takes a few seconds to run on Colab. There’s certainly room for optimization, or perhaps parallelizing with a GPU, but it’s good enough to get the job done.

We start by creating arrays for the x and y coordinates, and creating a grid from those.

Then, we set up a list of arrays, one for each emitter, that contains the distance to that emitter for every point on the grid. This just uses the basic equation for a circle, \( r^2 = x^2 + y^2 \), but \( x \) is offset by the positions of the emitters that we defined earlier.

We also need an empty array to store all the resulting arrays.

Then, we run the simulation by going through each emitter and calculating the wave pattern, assuming an isotropic source and inverse square path loss (antenna radiation patterns and various forms of attenuation are beyond the scope of this simulation). The equation is simply the equation for a wave, with the addition of the phase offsets we calculated earlier:

Finally, we have add up the results from all the emitters into a single array. This is where the interference between the different waves happens.

That’s it! Z is storing the final result of our simulation, so all we need to do now is plot it.

This part is pretty simple, if you’ve used Matplotlib before. It just setups up the graph and the labels, plots the results with enough contour lines that it appears smooth, and plots the positions of the emitters at the bottom.

Running this code will give us the following result:

graph of simulation results

Here, you can clearly see the beam being aimed in the direction we specified in the beginning. If you change dir to a different value and run the code again, the beam will be pointing in that new direction. This means the simulation is working as intended and actually simulating a phased array. But just to be sure, we should compare a few more aspects of the simulation to their theoretical values. To do this, we need to determine the radiation pattern of the beam.

Radiation Pattern

The radiation pattern is just a polar graph of the signal strength in various directions. The method described here is probably not the best way to calculate the radiation pattern, but it works well enough.

First, we set up the polar variables. The angles range from -90 to 90 degrees, which covers the entire grid we simulated on. The radii range across the beginning of the far field to almost the edge of the simulation bounds (this is why we rounded up the grid size). There’s also a list to hold the calculated gain values, and a variable to keep track of the number of angles we’re look at.

Next, we simply iterate through the angles and draw a line for each along the range of radii defined above.

We then go through each point and calculate the average power along the line. The equation used is essentially:

The \( \frac{1}{n} \) and the summation just calculate the average. The function \( E(x, y) \) gives us the amplitude of the wave at a given point. It’s squared since power is proportional to amplitude squared, and the \( 0.5 N \) part is the power input power into the emitters (since the average power of a sine wave with amplitude 1 is 0.5, and there are \( N \) emitters generating waves).

Then, the gains are all converted into decibels, and we start analyzing a few characteristics of the radiation pattern.

The maximum gain of a linear phased array is simply \( 10 \log_{10}{(N)} \), so we find the maximum value in the radiation pattern and see how they compare.

Which prints out:

That’s 4 significant figures of precision, not too bad. Let’s look at the beam width next.

The half power beam width (HPBW) is the angular width of the beam where the power is at least half the max power. In decibels, \( \frac{1}{2} = -3 \space \text{dB} \), so this just finds all the values within 3 dB of the max gain and calculates the angular distance between the first and last. The reference equation is \( \theta \approx \frac{0.866 \lambda}{N d \cos(\theta)} \), taken from the Analog Devices article.

This gives us:

This time, it’s accurate to within the 0.01 radians, which is the angular resolution we’re using.

Let’s take this array and plot it. The syntax is a bit more complicated since it’s a polar plot, but it’s basically just setting the bounds and orientation of the graph.

The graph is a bit jagged in places, probably due to the discrete nature of the simulation, so there’s still a bit of error. Still, it looks a lot like the radiation patterns you’d expect from a phased array.

polar plot of radiation pattern

So we have a simulation of a linear phased array that gives accurate results of some characteristics of the array, but only ones that can be easily calculated. What’s the point, then? Well, I started this project to try to give myself a better understanding of phased arrays, which I think has been a success. I hope it has done the same for anyone who has made it this far.

Next, I want to work on building a proper phased array. I tried doing one with piezo buzzers and microphones, but operating in the spectrum of human hearing made it difficult to work with. At some point I’ll have access to SDRs capable of being used in a small phased array, and I also have plans to build one of my own. I will try to document those experiment in a future post.

If you find any errors or inaccuracies in this post, let me know. I am definitely not an expert, but I’d like this to be as accurate as it can be.

  • Jupyter Notebook
  • Python File

IMAGES

  1. 2d arrays

    project stem assignment 9 2d arrays

  2. 2D Array: All You Need to Know About Two-Dimensional Arrays

    project stem assignment 9 2d arrays

  3. 9.1. Why and how to use 2D arrays?

    project stem assignment 9 2d arrays

  4. Lecture 9 2D Arrays and Nested Loops

    project stem assignment 9 2d arrays

  5. Arrays and ArrayLists: Two Dimensional Array

    project stem assignment 9 2d arrays

  6. Introduction to Arrays

    project stem assignment 9 2d arrays

VIDEO

  1. NPTEL Python for Data Science Week3 Quiz Assignment Solutions

  2. Introduction to 2D array part 1

  3. Coding Assignment 9

  4. How to use Destructuring Assignment in JavaScript

  5. Std 9 Final Assignment Science Section B Chapter 1 Solution English Medium|GSEB Vikas Assignment

  6. Problem Solving in 2D Arrays

COMMENTS

  1. Source code for the 2022-23 AP Computer Science A course on Project Stem

    Source code for the 2022-23 AP Computer Science A course on Project Stem. - GitHub - ricky8k/APCSA-ProjectStem: Source code for the 2022-23 AP Computer Science A course on Project Stem. ... Unit 8: 2D Array; Unit 9: Inheritance; Unit 10: Recursion; 📝 Contributing. Notice a typo or error? Feel free to create an issue! Please note that support ...

  2. Unit 9: 2D Arrays Flashcards

    9.1 Lesson Practice. It is not possible for an array to hold an array. False. Two-dimensional array indexes are listed as and . rows and columns. Two-dimensional arrays store information that can be represented as a ___. grid. 9.2 Lesson Practice. Consider the following code:grid = []grid.append ( ["frog", "cat", "hedgehog"])grid.append ...

  3. Project Stem Assignment 9: Flight Tracker. Been looking around ...

    Project Stem Assignment 9: Flight Tracker. Been looking around for this and haven't found anything so I think I'm the first to post. Pretty stumped and have three hours to submit it. ... I'm new to SQL and currently working on a project for a course I'm taking I've been able to answer a few of these but need help with the queries for the ...

  4. Assignment 9: 2D Arrays

    How by the input and output are processor processor. Write that reads and displays the t performed write the program

  5. Assignment 9

    Biomol Project Report; ... C Programming Assignment 9 2-D Arrays April 2022. For each of the programs assigned below, submit the source code (.c file) and the execution to Canvas under Assignment 9. ... Declare a two-dimensional array in function main (allow the array to contain up to 15 rows and 15 columns) and initialize elements to 0. ...

  6. assignment 9: Ultimate Frisbee : r/EdhesiveHelp

    public class Captain extends UltimatePlayer. {. private boolean type=false; public Captain (String firstName, String lastName, String position, boolean type) {. super (firstName, lastName, position); } public int throwDisc (int pow) {.

  7. Assignment 9 2D Arrays : r/EdhesiveHelp

    Assignment 9 2D Arrays . I need it ASAP if anyone can help it will be much appreciated comments sorted by Best Top New Controversial Q&A Add a Comment Upstairs_Ad9904 • Additional comment actions. a = [] for i in range(1): ...

  8. apcsa · GitHub Topics · GitHub

    Source code for the 2022-23 AP Computer Science A course on Project Stem. java computer-science ap-computer-science apcs apcsa edhesive project-stem Updated Jan 13 , 2024; Java ... In writing these methods you will learn how to traverse a two-dimensional array of integers or objects. You will also be introduced to nested loops, binary numbers ...

  9. # Project Stem

    This page contains the source code to various problems on Project Stem. Organized by unit, you will find the necessary activity files to be compiled by the Java environment, as well as runner files provided by Project Stem to test execution (when available). The provided source code is intended to work with the 2023 AP CS A course.

  10. ASSIGNMENT 9 FLIGHT TRACKER (project stem) Create and initialize a 2D

    To solve this problem, you need to create a 2D list with the given cities. First, write a printList() function that takes the list as a parameter and prints it. Then, create a flipOrder() function that reverses the order of each sublist in the original list. Explanation: To solve this problem, you need to create a 2D list with the given cities.

  11. PDF Unit 8: 2D Arrays

    2D Arrays Two dimensional arrays are especially useful when the data is naturally ... To explicitly put a value in an array, you can use assignment statements specifying the row and column of the entry. int[][] matrix = new int[3][4]; //3 rows, 4 columns ... is the one-dimensional array {-2,9,1,7}. mat.lengthis the number of rows. 3 -4 1 2 6 0 ...

  12. AP Computer Science A 2024

    Representing 2D Arrays. The 2D arrays can be represented in 2 major ways: one that is more visual, and one that is closer to how it is stored in the memory. Memory Representation. The first way to think about this is how it is stored in memory, or in terms of data structures. A 2D array in this form is just a nested array.

  13. 8. 2D Arrays

    8.1 Two-dimensional (2D) Arrays; 8.1.1 2D Arrays (Day 1) 8.1.5 Set Value(s) in a 2D Array (Day 2) 8.2 Traversing 2D Arrays (nested loops) 8.2.1 Nested Loops for 2D Arrays (Day 1) 8.2.5 Enhanced For-Each Loop for 2D Arrays (Day 2) 8.3 2D Arrays Summary; 8.4 Mixed Up Code Practice; 8.5 Toggle Mixed Up or Write Code Practice; 8.6 Code Practice ...

  14. Unit 6: Array

    # Assignment 6: Array Statistics Coding Activity StudentStatsArray.java. ... // Provided code from Project STEM. // No modifications were made to this file. public class Student { private String name; private double gpa; private int year; public Student(String name, double gpa, int year) { this.name = name; this.gpa = gpa; this.year = year ...

  15. Assignment 9 2D arrays : r/EdhesiveHelp

    Assignment 9 2D arrays . Does anyone have the code for this assignment. I need help comments sorted by Best Top New Controversial Q&A Add a Comment. More posts you may like. r ... Class Project. See more posts like this in r/EdhesiveHelp. subscribers . Top Posts Reddit . reReddit: Top posts of March 8, 2021.

  16. 8.6. Code Practice with 2D Arrays

    21. Activity: 8.6.1 ActiveCode (arr2DEx1q) Question. Answer. Discussion. Replace the "ADD CODE HERE" below with the code to declare and initialize a two-dimensional String array called students with the names "Brice, Marvin, Anna" in the first row and "Kamal, Maria, Elissa" in the second. The finished code will print all the names ...

  17. Project Stem Unit 8 Flashcards

    14%9 returns 5. 16%2 returns 8. 2%16 returns 2. array.insert (i, x) adds the (x) in the array at (i) without removing what was already there. remove. removes the first occurrence of the element in a list. Function. A function is a collection of instructions that the program will execute.

  18. project9.m

    Project 8 - Food Deserts Data Analysis & File Reading Code Restriction! Project Background Step 1: Grab the Data Step 2: Plot the Data The First Plot - "low income" Step 3: Correlation Q&A

  19. AP Computer Science Unit 6 Quiz Project Stem Flashcards

    The inner loop should go through the array up to the end to see if any of the elements in the array match the array at index k. It should begin with the first element after k, since if it begins at an index less than this, it will repeat checking each pair of variables twice, and more importantly end up comparing the value of the element at ...

  20. Intro to CS; Assignment 9: 2D Arrays : r/EdhesiveHelp

    This is a safe and open environment dedicated to the promotion of project management methodologies, with the purpose of fostering and promoting free discussion about all things project management. Check out r/PMcareers for career related posts.

  21. Assignment 9: 2D Arrays : r/EdhesiveHelp

    Need answers for a code practice? We got you! If you need answer for a test, assignment, quiz or other, you've come to the right place.

  22. FAQ: 2D Arrays: Java

    This community-built FAQ covers the "Declaration, Initialization, and Assignment" exercise from the lesson "2D Arrays: Java". Paths and Courses This exercise can be found in the following Codecademy content: Learn Java FAQs on the exercise Declaration, Initialization, and Assignment There are currently no frequently asked questions associated with this exercise - that's where you ...

  23. Simulating a Phased Array

    Next, we set up a few more things that will be used in the simulation. First is an array holding the positions of the emitters. This places each emitter at distance d apart, centered at x = 0. positions = np.linspace(-(N-1)*d/2, (N-1)*d/2, N) The phase offsets of all the emitters are set up in a similar way.