Hi everyone
I'd like to cut and paste a list of words into an array. I'll need to put quotation marks around them all. Is there a way to do this other than to go through each word one by one?
Thanks
TL;DR Summary: I am beginning research as an undergrad in Physics and have an example file I must analyze for the mean of each column. I cannot use arrays. I need to take the sum of a column of data.
Hi all, I am new to fortran and programming in general, but I'm having issues with creating a...
Hi PF!
I have a large dataset called data_dict I'm parsing that's stored as a numpy array. I'm subcategorizing it via a dictionary titled data_dict. Currently there is a dictionary key called key_curr that stores an np array data_col_prev. I'd like to append to this key data_col_curr. When I...
I'm working on an interesting task at the moment related to a core and fuel design for a fast reactor system. Given that the system is a fast reactor, we select a sensible lattice, i.e., a triangular or hexagonal lattice. Neutronically, one can solve for the necessary mass of enriched (less...
The general concept of 5G beamforming using phased arrays makes sense from the videos I've seen. Something I've noticed was that there are always side lobes and also the beam spreads as it travels. My hypothetical question is, is it possible to suppress all side lobes (side lobes -->0) and...
I feel like I have over complicated this question but here is the code I wrote out for it, I wrote it as a function but when I printed my values I realized I did not need a function to do so. So would I just use my second code to answer the question.
import numpy as np
def array_zero(n)...
Hi,
I’m reading the attached pdf article at https://www.microwavejournal.com/art...neration-radar about tile architecture in active phased arrays. Please help me with the following two questions.
1. Figure 2: Are this figure and the attached architecture (array.jpg) referred to the same...
I'm confused here. I guess my professor mean "statically" in the problem, but anyways, I thought, in C++, that declaring an array statically is the as declaring the array on the stack?
For example, if I have a function:
void staticArr(){
int a[10000];
}
here I am declaring an array...
I have two 2-D equal sized arrays (m×n) say a,b and want to print them in a single .txt file and have tried this using numpy
np.savetxt('data.txt',(a,b)) but it fails..,
Can anyone please help in sort out this
Thanks
Homework Statement
Take as input from the user an integer N. We don't want the user to enter very large integers, so exit with an error message if N>20. You may assume that N is an integer (and not a real number) and also that it is positive. Make two vectors v1 and v2 using v1.append() and...
Abstract:
The restoration of light response with complex spatiotemporal features in retinal degenerative diseases towards retinal prosthesis has proven to be a considerable challenge over the past decades. Herein, inspired by the structure and function of photoreceptors in retinas, we develop...
Arrays declared in java are stored in the memory in two ways: row-major-wise and column-major-wise.
As per our teacher, the choice of the storage technique depends on how we enter the array elements. For example, for this code:
int arr[][] = new int[10][10];
Scanner kb = new Scanner...
"Quantity in a group"
If you have 6 apples and you subtract 4, then you have 2 apples left "in the group".
"Quantity in an Indexed group"
I'm a computer programmer - I manipulate arrays of data (a.k.a. matrix)
In a math formula format: x1, x2, x3... xn
(as a side note - in a computer format...
Homework Statement
Create two 5x5 arrays, A & B, and ask the person to fill them out. Save those numbers in matrix_a.txt & matrix_b.txt respectively. Then, save the sum and difference of those numbers in sum.txt & diff.txt respectively.
Basically we need to create two arrays, fill them out...
This is a homework problem, so I have to follow some stipulations, namely:
The problem is, I have no idea how to get a method to return a generic-type array. Because of type erasure, I can't create an instance T[] of a generic array, empty or otherwise.
The only way I was able to do it was...
Hello, I cannot seem to get the calculations correct for my shopping cart to print out the tickets and total how many tickets and how much they are. The first set of code is for the shopping cart the comment sections are for what is suppose to be happening in each section. I have the menu...
< Mentor Note -- thread moved to HH from the technical Computer forum, so no HH Template is shown >
I have a homework problem which requires me to convert a word a user entered to Pig Latin by moving the first letter of the word to the end and adding an ay to it. For example, Tuesday becomes...
Hello, I am stuck on this question.The bold part is where I am stuck. I was able to get at least 2 out of the 3 test outputs but I can't seem to get the last one. I tired taking out the dividing by 2 but then the first test output doesn't work. Thank you.
Question:
For any element in keysList...
One of my professor's assignments is proving particularly tricky for me. It reads:
"Write the method
public static void sort(String[] a)
that sorts the array a in increasing order. The method must be
a short recursive program. Do not use quicksort or merge sort.
It should be a lot...
Hi,
I'm writing an HTML/Javascript application that will handle a large amount of data segregated into a set of n rings, each ring will have a set of m branches, and each branch will have four arrays of data, V, N, I, B. I would like to create a 3-D array to hold this data but am having...
Hi there,
I have 1024,1024 arrays (lots of them) which are really roughly 600,800 (it changes) and then buffered by zeros all the way around something like
000000000000000000
000000000000000000
000xxxxxxxxxxxxx000
000xxxxxxxxxxxxx000
000xxxxxxxxxxxxx000
000000000000000000
000000000000000000
i...
Dear Friends!
My post about dinamic arrays. For example little bit code.
// size
int const X = 5;
int const Y = 4;
int const Z = 3;
// one dimension array
printf("\nOne dimension\n");
// array of pointers
int * Arr;
// create array
Arr = new int [X]...
Homework Statement
So I'm getting an error when I try to compile my C++ code:
Debug Error
Abort() has been called
I have commented the code reasonably well, but the idea of the program is to take a file, separate the contents in each line to a part of a structure containing:
Product Lookup...
Hello,in this link http://dtic.mil/dtic/tr/fulltext/u2/a028054.pdf a paper „Maximum Theoretical Angular Accuracy of Planer and Linear Arrays of Sensors“ can be found.The accuracies are given in equations 19 (respect to the x axis) and 20 (respect to the y axis).My question is: Shall the angle...
Im wondering if pulsar arrays could see primordial gravity waves?
I have understood the only way to seem them would be to
a) via indirect imprint on CMB polarisation
b) direct viewing via some gigantic space based interferometer like Big Bang Observer
However I was looking at this image...
Behold this array of numbers:
3, 5, 11, 4
Sometimes, the programming limits the number of things that can be recorded in one location to a single number, such as 93240, but sometimes I also need to record an array of numbers such as the one shown above. An example of such platforms include the...
Homework Statement
I have an assignment with the following requirements for the functions:
Tax_Bracket_Identification. This function will identify the tax bracket. This function:
is of type int;
has one call-by-value argument (income);
uses nested if-else statements.
Tax_Calculation. Will...
Homework Statement
I am to write a program that has its user enter 100 character or less and determine if the line is a palindrome or not. I must use pointers one that starts at the beginning and one at the end of the array that must work their way in until they meet.(I'm also having trouble...
Homework Statement
So I created two arrays one called departure_time and the other arrival_time and populate each array as follows. I've tried both putting 8 and defining N as 8
int departure_times[N]={480, 538, 679, 767, 840, 945, 1140, 1305};
int arrival_times[N]={616, 712, 811, 900, 968...
Homework Statement
Assuming that array1 and array2 are both arrays, why is it not possible to assign
the contents of array2 to array1 with the following statement?
array1 = array2;Homework EquationsThe Attempt at a Solution
This is a question I just saw in a book. As far as I can tell the...
Homework Statement
You are provided the following list that contains (semi-random) years from modern history. Save the list to a text file named “events.txt” Write a program that: 1. Reads in the file “events.txt” 2. Sorts it with the latest events first 3. Determines whether the founding of...
I have 2 set of data (from different files) and I allocate each set of data to array in my main program. But now I want to merge those 2 array and sort them in ascending orders in my sub program. What should I do? I know how to sort array in ascending orders, but i don't know how to merge those...
Hey guys, I'm pretty new and desperate. I been trying to compile this program for a while and keep jumping from error to error.
Currently I have the following error:
Error: Rank mismatch in argument 't' at (1) (scalar and rank-1)
I have checked that my arrays are correctly. I have checked that...
So I am fairly new to Python and feel somewhat comfortable with it. I am trying to do something what I think seems kind of simple however am not too experienced with loading files into Python (or any programming language for that matter).
What I am trying to do is I have csv files that contain...
Homework Statement
Homework EquationsThe Attempt at a Solution
Okay, so first off I'm just trying to write the code for scalars:
--------------------------------------
clc ; clear
P = 2000
r = .035/12
n = 36
F = (1 + r).^n
A = (r*P*F)/(F-1)
---------------------------------------
This...
Homework Statement
I have a code that successfully plots the trajectory of a ball moving under gravity and air resistance, but my method is rather long-winded and I want to use a 4d vector-first order ODE instead - but I don't know how to do it. I've tried writing some simple skeletons but...
In this assignment, you are going to write a function called sortMe that sorts the elements of an array in numerical order from
highest to lowest values (descending order) or vice versa (ascending order).
The interesting point of the function is that sortMe does NOT re-arrange elements in the...
Homework Statement
Generate a triangle. For this problem, generate a triangle at a grid of points that are finely spaced in the x dimension. The triangle is defined as follows:
-Side 1: y = 0 for x = 0 to 2
-Side 2: x = 0 for y = 0 to 1
-Hypotenuse: y = 1-0.5x for x = 0 to 2
Alternatively, the...
Hi, I just realized that I have been making bad array assignments in my code. Specifically, I think I have been assigning to slots that the array does not have. For example, I might declare an array:
int,parameter :: nflavor=3
int,parameter :: nflavor2=nflavor*2
real,dimension(nflavor)::x...
The Question
Winning Lines
Tic-tac-toe is a game played by two players o and x. A player wins when he/she succeeds in placing three respective marks in a horizontal, vertical or diagonal row.
Given a 3-by-3 tic-tac-toe board, a winning line is a line (row, column or diagonal) that is not...
Hello,
I am preparing for the exam for my Matlab class, and have run into some confusion with Structure arrays. I have a hard time keeping all the concepts straight in my head. I am working on an old exam problem, where this is the structure array, which I will use as an example to demonstrate...
Hi folks,
To begin with, I have no past programming experience and have just begun to teach myself programming in FORTRAN 95 and I've hit a wall. I'd be very grateful for any assistance here.
I have around 150 text files with three columns of data (I have attached one as an example, and...
Hello everybody/reader,
Thank you for reading my post, i have been known to be long winded but i put a abridged version of my question and sectional labels so it can be skimmed easily for relevant information.
note: I Wrote a very explanatory post, which had sections and was written...
Hello,
I have attached a paper about Planar Interferometer Arrays. Now I’m trying to understand this paper but something confuses me. I am very thankful if somebody can help me with it.
1:
It seems to me that direction cosines and phase differences are 1:1 correspondent, that is, a phase...
Homework Statement
The problem is to dynamically allocate (closer to relocating) a dynamic class array in C++ based on the number of user inputs. We can't use vectors, malloc, realloc, or any such functions beyond new or anything simple like asking the user for how many questions they want to...
I'm working with this excercise: make a program that gives the number of consecutive letters of a word and the most repeated letter in a row -example: if i enter aaafdseergftth and i press return the program should return a = 3, e=2, t=2 and a=3-.
I've come up with a couple of "solutions"...