473,805 Members | 2,119 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help coding this algorithm

48 New Member
Hi,

I am stuck at a major part of the code in VC++.

My algorithm is as follows:


f_name = load(filename);
//this also loads a text file. The text files contains numbers sepearted by tab. it has 4 columns in it.

sum_text = sum(f_name(:, 4)) + 1;
// here we are calculating the sum of the 4th column elements and then adding 1 to it.

[Rows, Columns] = size(f_name);
//this computes the number of rows and columns in the text file, i.e. Rows contain no.of rows andcontains no.of columns in the text file

Matched = find(f_name(:, 4) >= 20);
//this will find which row has its 4th column element > 20 and returns that row number. It will contain all row numbers that satisfy the condition --> its 4th column element >= 20

for p = 1:length(Matche d)
{
R = f_name(Matched( p), 1);
//for example if the 1st row satisfies the above condition, then this will compute or return 1st row first element

G = f_name(Matched( p), 2);
//this will return 1st row, 2nd element

B = f_name(Matched( p), 3);
//this will return 1st row, 3rd element
}

Can someone help coding this one.
This is for my student project. Need help

Thanks,
Rishi
Jun 27 '07 #1
1 1455
sicarie
4,677 Recognized Expert Moderator Specialist
Which part of the algorithm, specifically, are you having trouble coding?
Jun 27 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
1812
by: Gunnar | last post by:
Hello. Problem: How can I select K random values from the elements 0,1,2,3,4...,N-1 ? I don't know if there's an easy way of doing this, but here are suggestions for doing it. One way is to select K random elements (using a rand()% N), and then see if any number was choosen twice, and then re-select the duplicats until the
144
6982
by: Natt Serrasalmus | last post by:
After years of operating without any coding standards whatsoever, the company that I recently started working for has decided that it might be a good idea to have some. I'm involved in this initiative. Typically I find that coding standards are written by some guy in the company who has a way of coding that he likes and then tries to force everybody else to write code the way he likes it, not for any rational reason, but simply for the...
23
3222
by: Simon Hengel | last post by:
Hello, we are hosting a python coding contest an we even managed to provide a price for the winner... http://pycontest.net/ The contest is coincidentally held during the 22c3 and we will be present there. https://events.ccc.de/congress/2005/wiki/Python_coding_contest
3
2045
by: Charleees | last post by:
Hi all, I need C# code for Implementing MD5 Algorithm.. Hope all would have heard of MD5 Algorith... Does any one have the C# coding for that Algorithm.. please Send... ITs URgent..... Thanks In Advance to all....................... With Regards,
1
3849
by: Charles | last post by:
Hi all, I need C# code for Implementing MD5 Algorithm.. Hope all would have heard of MD5 Algorith... Does any one have the C# coding for that Algorithm.. please Send... ITs URgent..... Thanks In Advance to all....................... With Regards,
1
1204
by: Charles | last post by:
Hi all, I need C# code for Implementing MD5 Algorithm.. Hope all would have heard of MD5 Algorith... Does any one have the C# coding for that Algorithm.. please Send... ITs URgent..... Thanks In Advance to all....................... With Regards,
3
1703
by: raajagopal.v | last post by:
hallo comp.lang.c i am a student trying to sole the bisection method in numerical methods to find the root of any equation,i need the coding because i dont know how to implement the polynomial function or expression that the user gives to execute will any one give the coding ? please help me
19
3981
by: auratius | last post by:
http://www.auratius.co.za/CSharpCodingStandards.html Complete CSharp Coding Standards 1. Naming Conventions and Styles 2. Coding Practices 3. Project Settings and Project Structure 4. Framework-Specific Guidelines Naming Conventions and Styles
6
1704
by: StephQ | last post by:
I need to implement an algorithm that takes as input a container and write some output in another container. The containers involved are usually vectors, but I would like not to rule out the possibility of using lists. The problem is that I need two versions of it, depending if I'm adding the generated (by the algorithm) values to the target container or if I just modify pre-existing values of the target container. Efficiency is important...
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10613
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10368
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4327
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3846
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.