Questions tagged [subscript]

A subscript is a number, figure, symbol, or indicator that is smaller than the normal line of type and is set slightly below the baseline.

Subscripts are common in mathematical notation (generally indicating position, such as the index of a variable in a vector) and chemistry formulas (e.g. H2O).

Subscript and superscript (Wikipedia)

625 questions
0
votes
0 answers

string subscripting error in Maze program

I need to create a program for class that inputs a file of a Maze into a two dimensional vector so the computer can return the vector to a class Maze. I'm currently working on the function that loads the Maze input into a vector. Every time I run…
Tammytee
  • 592
  • 5
  • 9
0
votes
1 answer

subscript out of boundaries when trying to fill matrix with values in r

I am trying to run a VaR model on my time series for different alpha values and always come up with the error Error in[<-(tmp, i + seq[1], j, value = 0.09265792) : subscript out of bounds when i try to get my results in a matrix form with different…
philippe
  • 47
  • 7
0
votes
1 answer

Removing element from vector / deleting object

I am going crazy about two issues I am having with my code. I am trying to delete an element from my vector containing a list of objects. //Remove Object if (button2 == true) { //go through objects and check collision for…
cedifra
  • 95
  • 6
0
votes
0 answers

How to get Superscript over subscript in XML?

I'm coding a program for Android, and I have to display some text with chemistry notation. Using regular subscripting works when it is defined as a String resource, like this: OH-, [mg/l] This will show up as…
jangerhard
  • 35
  • 1
  • 5
0
votes
3 answers

C++ overload of operator[] not working with template class

I have a template class Profile which consists of a std::vector and some functions that I perform on the vector. I'm trying to use Profile::operator[] to access the vector directly, but I'm getting an error on compile. Profile template
Tim Anderson
  • 93
  • 1
  • 6
0
votes
0 answers

How to calculate average of a matrix under two conditions using R?

I have a big data file named DATA of matrix containing 1200 rows and 19 columns. I would like to calculate the mean of column 16 if the difference between two consecutive rows is 1 sec and if the number of measurements in that given day is more than…
0
votes
3 answers

R subscript based on a vector

df <- data.frame(name=c('aa', 'bb', 'cc','dd'), code=seq(1:4), value= seq(100, 400, by=100)) df v <- c(1, 2, 2) v A <- df[df$code %in% v,]$value A str(A) I tried to obtain the corresponding value based on the code. I was expecting…
0
votes
2 answers

Expression: string subscript out of range. Attribute passing issue?

I am running into an error during my program's runtime: "Debug Assertion Failed! ... Expression: string subscript out of range." This is happening in my for loop when my if statement attempts to check if the character at 'i' in the string…
Dreiak
  • 69
  • 3
  • 7
0
votes
2 answers

How to simplify usage of overloaded subscript operator via pointer?

I have a class Foo that encapsulates access to a vector and provides access to it via the subscript operator: typedef int* IntPtr; class Foo { std::vector bars; IntPtr& operator[](size_t idx) { return bars[idx]; } }; In…
mort
  • 12,988
  • 14
  • 52
  • 97
0
votes
1 answer

Subscript out of Range VBA

Thanks for joining me, glad i am here my problem is Subscript out of range when i am trying to copy and paste the data in individual tabs using with Offset option, i have given my code here Private Sub CommandButton1_Click() Call UnprotectSheets Dim…
0
votes
1 answer

invalid types 'float*[float]' for array subscript

#include using namespace std; float n; float fact(float m) { float prod=1; while(m>1) { prod*=m; m--; } return prod; } //////////////////////////////// float min(float…
atulj
  • 71
  • 2
  • 4
  • 10
0
votes
2 answers

std::vector subscript out of range while reading a file into the vector of strings in C++

I am new to c++. I am learning fast, but i dont know much yet. I cannot see the problem with index in this function: #include #include #include #include using namespace std; void get_rows(string filepath,…
Rokusjar
  • 209
  • 1
  • 4
  • 11
0
votes
1 answer

How to save data superscript in SQlite iOS?

I have a problem as this question: Want to add Superscript data to Sqlite database Can you give me an example about INSERT statement. I don't know more about and , and unicode characters. Thanks you!
user2678221
  • 15
  • 1
  • 8
0
votes
3 answers

How to Count Most & Least Common Characters in Input?

This is my assignment: Write a program which reads in text from the keyboard until an exclamation mark ('!') is found. Using an array of integers subscripted by the letters 'A' through 'Z', count the number occurrences of each letter. In a…
user2680935
  • 29
  • 2
  • 10
0
votes
2 answers

Subscripting an Array of Integers in Python?

I'm absolutely terrible at Python and my Computer Programming class ends in two days (thank god), but I am having the hardest time figuring out what is probably the easiest code ever. The instructions to my assignment state, "Write a program which…
user2680935
  • 29
  • 2
  • 10