{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# ML8 - Matlab 8 Triplets Problem Tian Gu ID 853324472 The...

This preview shows pages 1–2. Sign up to view the full content.

Matlab 8 Triplets Problem! Tian Gu ID: 853324472 The Triplet Problem Introduction : Last time I came out some clues to solve the triplet problem (triplet: number =a*b*c), this time I will try to work this out by program. To prevent the previous work which may interfere with the progress of the program, we always clear all first. close all clear all clc Now we should ask the user to input a number. numb = input( 'Please input a integer number: ' ); I think the best way to solve this is still using for loop which I mentioned in last report. The triplet has three numbers each column. So what about we loop every number and find the satisfied combinations? Anyway, we set a, b, c at first for a = 1:numb for b = 1:numb for c =1:numb Now we should consider the condition they should satisfied which is the set of numbers can be only displayed once. This means the three numbers cannot appear in other order again. So we can we put this restriction in this program.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 5

ML8 - Matlab 8 Triplets Problem Tian Gu ID 853324472 The...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online