167 Topics

Member Avatar for
Member Avatar for Annettest

Hello everyone: I am a C++ newbie. I have used Matlab to fill the rows or columns of a matrix with values from a vector and I'm wondering how to do the same thing in C++... I have written code that puts new values in a vector. This happens in …

Member Avatar for Lerner
0
256
Member Avatar for amylyn7

I need to write a program that displays a single character in all possible combination of foreground and background [U][COLOR="Green"][COLOR="Red"]colors [/COLOR][/COLOR][/U](16x16 = 256). The colors are numbered from 0 to 15, so use a [COLOR="Red"]nested loop[/COLOR] to generate all possible combinations. The character to be displayed should be obtained from …

0
81
Member Avatar for Dragonator

Hello. First of all I'd like to say HI to everyone. I've recently joined this community and this is my first post. I have a class called Numerical Calculus where the assignments often require the input and representation in a GUI of various matrices. So I've been looking for ways …

Member Avatar for Dragonator
0
1K
Member Avatar for ParadoxKing

Hello, I am writing a program that does matrix Multiplication using 2-dimensional arrays and a Matrix Class. The program compiles without any errors but when I get to the part of the program where it actually multiplies the 2 matrices it throws an exception. I've looked through the code several …

Member Avatar for Salem
0
409
Member Avatar for sssouljah

Hello i was wondering how to store a tridiagonal matrix in c++ i know i have to use three arrays for the upper lower and diagonal terms, but how do i then use parenthesis operator to access single elements of the matrix when it is stored as three separate arrays....also …

Member Avatar for jonsca
0
199
Member Avatar for v_janssens

Hi, I'm trying to find a way to calculate the eigenvalues and eigenvectors for a square symmetrical matrix. I have used MATLAB to do this before and the solution was as simple as; [V,D] = eig(A) I'm wondering if there is a simple solution like this in c++. I am …

Member Avatar for DavidB
0
299
Member Avatar for sexyzebra19

I'm using the header file below. I'm a little confused about how to store any matrices I create... If I do: [code=php] int main() { Matrix A(2, 3); Matrix B(3); return 0; } Matrix::Matrix(int mdim_, int ndim_) { data_.resize (mdim_*ndim_); for (int i = 0; i < mdim_*ndim_; i++) { …

Member Avatar for Fbody
0
124
Member Avatar for maddav

Hi, I'm very much a beginner to C++, but I've been assigned a project outside of my programming class that is starting to get tricky. I'm modelling a layered optical system and I need to create N two-dimensional arrays (2x2 matrices to be used in matrix multiplication), where N is …

Member Avatar for maddav
0
186
Member Avatar for PMACLEAN

Could someone please advise me on how to implement fork() in a parallel processing (multiplying) of a 2d array....I have been at this for far too long.. here is my code [code] for (int i = 0; i < rowCol[0]; i++ ) result[i] = (float*)malloc ( rowCol[1] * sizeof(float) ); …

Member Avatar for abhimanipal
0
178
Member Avatar for vidit_X

Practise problem by ~s.o.s~ Q. Write a program which performs addition, subtraction, multiplication of matrices. The dimensions of both the matrices would be specified by the user (dynamic memory allocation required). Use of structure or a class to define the matrix would be a good idea. (Expert) [CODE]#include<iostream> using namespace …

Member Avatar for vidit_X
0
261
Member Avatar for ishandoshi

Hii, The problem statement i am referring to is: Buttons Each cell of an N x N grid is either a 0 or a 1. You are given two such N x N grids, the initial grid and the final grid. There is a button against each row and each …

0
85
Member Avatar for fjrivash

Dear all, is there is a way to go trough a matrix using just one "for" loop?, I mean I have this snippet: [CODE] #define WIDTH 5 #define HEIGHT 3 int mat [HEIGHT * WIDTH]; int n,m; int main () { for (n=0;n<HEIGHT;n++) for (m=0;m<WIDTH;m++) { mat[n*WIDTH+m]=(n+1)*(m+1); } return 0; …

Member Avatar for fjrivash
0
86
Member Avatar for Vishu Madaan

#include<stdio.h> #include<conio.h> void main() { int a[10][10],b[10][10],c[10][10],i,j,k,m,n,p,q; printf("Enter The Rows And Cloumns in the Matrix:"); scanf("%d %d",&m,&n); printf("\nEnter Elements Of The Matrix:\n"); for(i=0;i< m;i++) { for(j=0;j< n;j++) { scanf("%d",&a[i][j]); } } printf("The First Matrix Is:\n"); /* Print the first matrix */ for(i=0;i< m;i++) { for(j=0;j< n;j++) printf(" %d ",a[i][j]); printf("\n"); …

Member Avatar for Ancient Dragon
0
93
Member Avatar for Ankush dhingra

void main() { int a[10][10],b[10][10],c[10][10],i,j,k,m,n,p,q; printf("Enter The Rows And Cloumns And Of The First Matrix:"); scanf("%d %d",&m,&n); printf("\nEnter The Rows And Cloumns And Of The Second Matrix:"); scanf("%d %d",&p,&q); printf("\nEnter Elements Of The First Matrix:\n"); for(i=0;i< m;i++) { for(j=0;j< n;j++) { scanf("%d",&a[i][j]); } } printf("\nEnter Elements Of The Second Matrix:\n"); …

-5
75
Member Avatar for Peppercat101

I have a slight problem, I have a dynamicSizeMatrix that has a member [CODE] ListAsLinkedList** theList; [/CODE] Now this ListAsLinkedList can be either DLL or SLL, now it all works fine but when I add elements like this: [CODE] DynamicSizeMatrix hello(ListAsDLL(),5); hello.addToList(0,2,new Integer(10)); hello.addToList(1,4,new Integer(6)); hello.addToList(2,6,new Integer(8)); hello.addToList(3,8,new Integer(7)); hello.addToList(4,10,new …

0
103
Member Avatar for soffie

Need to make a random size (x = rows, y = columns) matrix which is filled with random numbers (only 0 or 1). So, if I don't know the size of the matrix, I use dynamic array. So far I have made this far, but obviously it isn't quite correct... …

Member Avatar for soffie
0
2K
Member Avatar for sjcomp

Hello, In my program I have clipping planes setup for 60 degree field of view. I understand that near plane is in front of the camera and the far plane is further away from the camera. I would like to have a large field of view, let' say more than …

0
94

The End.