textread and textscan always return columns . There is no way to tell them to return rows.
Syntax for make a row vector vs column
19 次查看(过去 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 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!