How to do this vector operation in MATLAB ?

  • Context: MATLAB 
  • Thread starter Thread starter dexterdev
  • Start date Start date
  • Tags Tags
    Matlab Vector
Click For Summary

Discussion Overview

The discussion revolves around a MATLAB programming question regarding vector operations. The initial post presents a specific problem involving the creation of a vector from several cosine functions and the assignment of numerical values to these vectors. The context includes programming and mathematical reasoning related to signal processing.

Discussion Character

  • Homework-related
  • Mathematical reasoning

Main Points Raised

  • One participant describes a set of cosine vectors and their intended combination into a single vector, seeking assistance in creating a corresponding numerical vector.
  • Another participant suggests that the task of creating the vector may be straightforward, given the size of the original vector and the desired output.
  • A separate participant introduces a different topic about simulating a race track in MATLAB, indicating a shift in focus from the original question.
  • Responses include guidance on how to start a new thread for unrelated questions, emphasizing the need for clarity and detail in problem statements.

Areas of Agreement / Disagreement

The discussion does not reach a consensus on the original MATLAB question, as it shifts focus to a new topic. The initial query remains unresolved, with no clear solutions provided for the vector operation issue.

Contextual Notes

The initial post lacks detailed information on the specific operations or functions the participant has attempted in MATLAB, which may limit the ability of others to provide targeted assistance.

dexterdev
Messages
194
Reaction score
1
Hi friends,
I wanted a help in Matlab programming. I have some vectors as below :

d4=cos(2*pi*293.665*(0:1/44100:.25));
f4=cos(2*pi*349.228*(0:1/44100:.25));
e4=cos(2*pi*329.628*(0:1/44100:.25));
g4=cos(2*pi*391.995*(0:1/44100:.25));
c5=cos(2*pi*523.251*(0:1/44100:.25));
bb4=cos(2*pi*466.164*(0:1/44100:.25));
a4=cos(2*pi*440*(0:1/44100:.25));
c4=cos(2*pi*261.626*(0:1/44100:.25));

and finally a vector x build from the above vectors :

x=[c4 c4 d4 c4 f4 e4 c4 c4 d4 c4 g4 f4 c4 c4 c5 a4 f4 e4 d4 bb4 bb4 a4 f4 g4 f4];

here a4 must be assigned 1, bb4 - 2, c4 - 3, d4 - 5, e4 - 6 , f4 - 7 and g4 - 8. I wanted to create a vector y from x. y must be as below :

y = [3 3 5 3 7 6 3 3 5 3 8 7 3 3 4 1 7 6 5 2 2 1 7 8 7] ;

TIA
 
Physics news on Phys.org
Some more information would help here. Based on what you've written it looks like typing in that vector works just fine, given that you want to take a vector with 275k+ elements and turn it into one with 25.
 
Track representation in Matlab

Hi,

I was wondering if anyone could help me. I need to simulate a race track using MATLAB and do not know how to go about this?

Any suggestions welcome.

Thank you
 
RacingFan, start a new thread and include as much information as possible on the problem,as well as what you've tried already.
 
How do i start a new thread? sorry new to this!
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
5K
Replies
7
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K