Syntax for make a row vector vs column
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi there, I've used Matlab for a couple years working primarily off of other people's scripts, but I'm finally trying to really learn the syntax myself to customize/improve these, and running into what I'm sure are very, very basic questions. In my current code I have two vectors of data that I normalize and create two new vectors from (with Norm appended to the front), and then I want to concatenate those two, normalized pieces of data, together.
I realized that it wasn't working within the current function I was using because the normalized vectors I am creating are column vectors, not row vectors. When I manually transpose the vectors prior to running the concatenate section of the program, it works fine. I suspect that because I am reading in the data from a text file that contains two columns of data, Matlab is automatically just making the vectors into columns as well.
My question is: How do I indicate when making a vector that I want it to be a column vs. row vector? OR is it better to just switch the type of vector after making it?
Here is the code I am using to read in the data and then normalize it
[B_X,Spc_XIntD_90sec] = textread ('BCintBCEKM092917_Xband_D2O_90sec_5K_9_639GHz_4096.txt','%f %f');
[Norm_Spc_XIntD_90sec] = Spc_XIntD_90sec/(max(Spc_XIntD_90sec) - min(Spc_XIntD_90sec));
Thanks for any help!
댓글 수: 0
답변 (1개)
Walter Roberson
2019년 3월 3일
textread and textscan always return columns . There is no way to tell them to return rows.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!