Combination of letter vector with matlab digital vector
source link: https://www.codesd.com/item/combination-of-letter-vector-with-matlab-digital-vector.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Combination of letter vector with matlab digital vector
I wish to combine a vector of letters
AssetList(1,2:end)
ans =
'a' 'b' 'c' 'd' 'e'
with a vector of numbers
x
x =
0.3857
0.2143
0.0000
0
0.4000
to create a table where a=0.3857 etc but I get errors no matter what I try. For example:
y=cat(2,alldata(1,2:end)',x)
Error using cat Dimensions of matrices being concatenated are not consistent.
I am not sure what you want, perhaps something like this:
x = 'a':'e'
y = 11:15
C = cell(5,2)
for t = 1:5
C{t,1}=x(t)
C{t,2}=y(t)
end
It can of course be vectorized, but I find this solution easier to understand.
Related Articles
How can I generate all possible combinations of a vector
Generates combinations from a value in matlab
How to adapt a curve with a circle with matlab?
How can I combine two scalaz streams with a predicate selector?
Combine OUTPUT insert.id with the value of the selected row
How to make NSDecimalNumber pass basic data to the label with 2 digits after, or. even if the value is round
Combining batch RDD results with RDD streaming in Apache Spark
How to format a number 0..9 to display with 2 digits (this is NOT a date)
Analysis of numbers with multiple digits in Prolog
Writing log statements to standard output with Matlab
Converting 2D 3D images with MATLAB
Compare a combination of two columns with a combination of two other in SQL
Using GitHub with MATLAB R2014b
Regular expression to check a string with 4 digits and space?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK