Using custom colormap on contourf - matlab

I have created a colourmap 'mycmap' which I want to use on every contourf in Matlab. How do this?
I have tried
[C,h]=contourf(Xrange,Y_range,capacity,14,'LineColor',mycmap');
but it doesn't work. My custom colour scale looks like:
mycmap =
0.9725 0.9725 0.9725
0.9442 0.9442 0.9442
0.9159 0.9159 0.9159
0.8876 0.8876 0.8876
0.8593 0.8593 0.8593
0.8310 0.8310 0.8310
0.8027 0.8027 0.8027
0.8002 0.8002 0.8002
0.7976 0.7976 0.7976
0.7950 0.7950 0.7950
0.7924 0.7924 0.7924
0.7204 0.7204 0.7204
0.6484 0.6484 0.6484
0.6484 0.6484 0.6484
0.6484 0.6484 0.6484
0.6329 0.6329 0.6329
0.6175 0.6175 0.6175
0.6021 0.6021 0.6021
0.5885 0.5885 0.5885
0.5750 0.5750 0.5750
0.5615 0.5615 0.5615
0.5480 0.5480 0.5480
0.5345 0.5345 0.5345
0.5210 0.5210 0.5210
0.5075 0.5075 0.5075
0.4940 0.4940 0.4940
0.4564 0.4564 0.4564
0.4188 0.4188 0.4188
0.4092 0.4092 0.4092
0.3995 0.3995 0.3995
0.3899 0.3899 0.3899
0.3802 0.3802 0.3802
0.3706 0.3706 0.3706
0.3609 0.3609 0.3609
0.3512 0.3512 0.3512
0.3416 0.3416 0.3416
0.3328 0.3328 0.3328
0.3239 0.3239 0.3239
0.3151 0.3151 0.3151
0.3063 0.3063 0.3063
0.2974 0.2974 0.2974
0.2886 0.2886 0.2886
0.2798 0.2798 0.2798
0.2771 0.2771 0.2771
0.2743 0.2743 0.2743
0.2716 0.2716 0.2716
0.2689 0.2689 0.2689
0.2661 0.2661 0.2661
0.2634 0.2634 0.2634
0.2607 0.2607 0.2607
0.2580 0.2580 0.2580
0.2552 0.2552 0.2552
0.2525 0.2525 0.2525
0.2498 0.2498 0.2498
0.2471 0.2471 0.2471
0.2196 0.2196 0.2196
0.1922 0.1922 0.1922
0.1647 0.1647 0.1647
0.1373 0.1373 0.1373
0.1098 0.1098 0.1098
0.0824 0.0824 0.0824
0.0549 0.0549 0.0549
0.0275 0.0275 0.0275
0 0 0
Thanks for helping.

You could invoke the colour map after the plotting...
[C,h]=contourf(Xrange,Y_range,capacity,14)
colormap(mycmap);

Related

smooth filtering shifts my original signal?

Here is my code:
sigma = 10;
sz = 20;
x = linspace(-sz / 2, sz / 2-1, sz);
gf = exp(-x .^ 2 / (2 * sigma ^ 2));
gf = gf / sum (gf); % normalize
f_filter = cconv(gf,f,length(f));
Basically I am Gaussian filtering original signal f. However, when I look at the filtered signal f_filter, there is a shift comparing the original signal f (See attached figure). I am not sure why this is happening. I would like to only smooth but not shift the orginal signal. Please help. Thanks.
my original signal f is here:
-0.0311
-0.0462
-0.0498
-0.0640
-0.0511
-0.0522
-0.0566
-0.0524
-0.0478
-0.0482
-0.0516
-0.0435
-0.0417
-0.0410
-0.0278
-0.0079
-0.0087
-0.0029
0.0105
0.0042
0.0046
0.0107
0.0119
0.0177
0.0077
0.0138
0.0114
0.0103
0.0089
0.0122
0.0122
0.0118
0.0041
0.0047
0.0062
0.0055
0.0033
0.0096
0.0062
-0.0013
0.0029
0.0112
0.0069
0.0160
0.0127
0.0131
0.0039
0.0116
0.0078
0.0018
0.0023
0.0133
0.0140
0.0135
0.0098
0.0100
0.0133
0.0131
0.0086
0.0114
0.0131
0.0175
0.0137
0.0157
0.0040
0.0136
0.0009
0.0049
0.0157
0.0104
0.0038
0.0039
0.0029
0.0126
0.0044
0.0055
0.0040
0.0091
-0.0023
0.0107
0.0151
0.0115
0.0135
0.0160
0.0071
0.0098
0.0094
0.0072
0.0079
0.0055
0.0155
0.0107
0.0108
0.0085
0.0099
0.0055
0.0078
0.0027
0.0121
0.0077
0.0062
0.0021
-0.0019
-0.0003
-0.0022
0.0059
0.0099
0.0114
0.0069
0.0038
0.0020
-0.0031
0.0024
-0.0025
-0.0004
0.0041
0.0059
0.0018
0.0033
0.0130
0.0131
0.0076
0.0084
0.0029
0.0086
0.0078
0.0054
0.0121
0.0101
0.0132
0.0115
0.0074
0.0070
0.0088
0.0017
-0.0003
-0.0060
0.0078
0.0100
0.0044
0.0017
0.0027
0.0062
0.0029
-0.0035
0.0032
0.0060
-0.0035
0.0081
0.0027
0.0043
0.0013
0.0049
0.0119
0.0273
0.0363
0.0435
0.0432
0.0357
0.0424
0.0318
0.0341
0.0354
0.0325
0.0263
0.0320
0.0312
0.0345
0.0407
0.0378
0.0376
0.0334
0.0381
0.0428
0.0375
0.0431
0.0403
0.0395
0.0308
0.0150
0.0006
0.0054
0.0002
0.0090
0.0075
0.0051
0.0067
0.0062
0.0108
0.0059
0.0095
0.0065
0.0087
0.0056
0.0136
0.0057
0.0079
0.0107
0.0106
0.0041
0.0032
0.0106
0.0091
0.0082
0.0025
0.0124
0.0035
0.0034
0.0097
0.0034
0.0050
0.0119
0.0087
0.0081
0.0118
0.0088
0.0050
0.0050
0.0057
0.0118
0.0122
0.0207
0.0112
0.0125
0.0083
0.0125
0.0140
0.0147
0.0237
0.0206
0.0141
0.0164
0.0189
0.0189
0.0136
0.0183
0.0195
0.0209
0.0154
0.0211
0.0254
0.0163
0.0249
0.0236
0.0262
0.0278
0.0285
0.0275
0.0212
0.0277
0.0211
0.0248
0.0289
0.0240
0.0266
0.0479
0.1744
0.4070
0.6818
0.8811
0.9859
0.9347
0.8441
0.7625
0.6396
0.4724
0.3639
0.3406
0.3406
0.3363
0.3318
0.3251
0.3287
0.3135
0.3122
0.3058
0.3103
0.3012
0.2974
0.2995
0.2941
0.2981
0.2968
0.2958
0.2938
0.2929
0.2926
0.2942
0.2982
0.2898
0.2940
0.2927
0.2950
0.2899
0.2979
0.2915
0.2961
0.2921
0.2931
0.2989
0.2941
0.2977
0.3041
0.3042
0.3086
0.3048
0.3069
0.3055
0.3123
0.3138
0.3128
0.3115
0.3092
0.3174
0.3152
0.3106
0.3080
0.3166
0.3109
0.3103
0.3135
0.3101
0.3133
0.3147
0.3044
0.2980
0.2972
0.3013
0.2980
0.3069
0.3932
0.6593
0.8921
1.1071
1.2763
1.3947
1.5076
1.6278
1.7452
1.7993
1.8287
1.8470
1.8957
1.9408
1.9791
2.0272
2.0686
2.0974
2.1335
2.1790
2.2134
2.2545
2.2903
2.3163
2.3585
2.3739
2.4126
2.4503
2.4787
2.5198
2.5447
2.5950
2.6228
2.6410
2.6812
2.7123
2.7557
2.8584
3.2480
3.5315
3.6808
3.7632
3.7471
3.7283
3.6692
3.6718
3.7756
3.9672
4.0376
3.9092
3.7276
3.6586
3.5948
3.6392
3.5671
3.6003
3.6194
3.6350
3.6624
3.6855
3.6958
3.9105
4.3880
5.1342
5.6176
6.3206
7.0392
7.3767
7.5715
7.6516
7.6469
7.5871
7.4591
7.6004
7.5532
7.3601
7.1487
5.9728
4.8974
4.5850
4.4268
4.3352
4.2887
4.3376
4.3182
4.2909
4.2777
4.2548
4.2677
4.2511
4.2817
4.3847
4.4418
4.4696
4.4932
4.4998
4.5151
4.5096
4.5278
4.5139
4.5020
4.4561
4.4067
4.3841
4.3638
4.3750
4.4366
4.5258
4.6565
4.6485
4.5836
4.5183
4.4583
4.3747
4.3509
4.2938
4.2823
4.2844
4.3135
4.3262
4.3255
4.2568
4.2011
4.1832
4.2278
4.2445
4.2409
4.2784
4.2917
4.3035
4.3015
4.3209
4.3204
4.3356
4.3287
4.3260
4.3483
4.3710
4.3798
4.3802
4.3805
4.5162
4.6906
5.0826
5.6588
6.0137
6.2436
6.5361
7.0790
7.6106
7.6410
7.4120
7.4535
7.2476
7.2596
7.1012
7.0986
6.9395
6.5633
5.8438
4.9434
4.6750
4.4320
4.3063
4.2096
4.0193
3.9698
4.0055
4.0218
4.0426
4.0688
4.0650
3.9793
3.9787
3.9766
3.9981
4.0405
4.0165
4.0290
4.0923
4.0897
4.0615
4.0258
4.0008
4.0274
4.0553
4.0646
4.0442
4.0477
3.9986
4.0354
4.0718
4.0563
4.0189
3.8631
3.8144
3.7736
3.8055
3.9730
4.0299
4.0148
3.8265
3.4675
3.3020
3.2474
3.2338
3.1986
3.1680
3.1289
3.0944
3.0523
3.0094
2.9510
2.9246
2.9057
2.8805
2.8545
2.8245
2.7690
2.7236
2.6833
2.6443
2.5969
2.5415
2.4684
2.4214
2.3699
2.3293
2.2513
2.1963
2.1285
2.0700
2.0209
1.9575
1.8658
1.6996
1.5120
1.4020
1.3087
1.2166
1.1441
1.0774
1.0226
0.9809
0.9448
0.8526
0.6915
0.4491
0.2842
0.2582
0.2570
0.2568
0.2609
0.2632
0.2581
0.2552
0.2539
0.2527
0.2578
0.2672
0.2701
0.2655
0.2658
0.2688
0.2761
0.2767
0.2738
0.2774
0.2801
0.2817
0.2803
0.2830
0.2828
0.2876
0.2952
0.2985
0.3016
0.3092
0.3130
0.3153
0.3182
0.3304
0.3471
0.3416
0.3476
0.3497
0.3453
0.3398
0.3448
0.3563
0.3511
0.3502
0.3481
0.3519
0.3573
0.3544
0.3512
0.3489
0.3499
0.3470
0.3533
0.3409
0.3556
0.3474
0.3435
0.3460
0.3519
0.3447
0.3395
0.3488
0.3473
0.3453
0.3433
0.3484
0.3526
0.3494
0.3607
0.3694
0.4126
0.4604
0.5004
0.5163
0.5328
0.5432
0.5506
0.5485
0.5605
0.5586
0.5622
0.5727
0.5804
0.5797
0.5666
0.5700
0.5696
0.5722
0.5715
0.5656
0.5572
0.5264
0.5156
0.5473
0.6286
0.7503
0.8715
0.8825
0.7507
0.5421
0.2869
0.1091
0.0423
0.0326
0.0343
0.0256
0.0231
0.0281
0.0298
0.0229
0.0283
0.0279
0.0270
0.0300
0.0245
0.0360
0.0280
0.0270
0.0232
0.0276
0.0270
0.0237
0.0197
0.0193
0.0172
0.0140
0.0093
0.0244
0.0226
0.0192
0.0145
0.0124
0.0167
0.0182
0.0111
0.0147
0.0081
0.0151
0.0130
0.0113
0.0131
0.0067
0.0028
0.0064
0.0069
0.0082
0.0075
0.0098
-0.0008
0.0037
0.0019
0.0060
0.0057
0.0033
0.0079
0.0122
0.0091
0.0067
-0.0038
0.0033
0.0013
0.0011
0.0034
0.0051
0.0009
-0.0001
-0.0005
0.0098
-0.0003
0.0067
0.0038
0.0106
0.0000
0.0126
0.0134
0.0090
0.0116
0.0083
0.0101
0.0152
0.0010
0.0068
0.0008
0.0053
0.0090
0.0087
0.0085
0.0054
0.0089
0.0077
0.0064
0.0046
0.0058
0.0025
0.0132
0.0088
0.0043
0.0052
0.0087
0.0122
0.0023
0.0066
0.0093
0.0042
0.0042
0.0138
0.0051
-0.0055
-0.0002
0.0048
0.0063
0.0076
0.0016
-0.0005
0.0086
0.0043
-0.0016
0.0100
0.0097
0.0042
0.0092
0.0051
0.0029
0.0044
0.0033
0.0073
0.0093
0.0077
0.0093
0.0021
0.0026
0.0093
0.0068
0.0039
0.0068
0.0041
0.0053
0.0037
0.0075
0.0016
0.0000
-0.0005
0.0073
0.0076
0.0049
0.0046
0.0087
0.0106
0.0072
0.0085
0.0036
0.0044
0.0043
0.0201
0.0076
0.0075
0.0134
0.0050
0.0071
0.0032
0.0055
0.0085
0.0046
0.0023
-0.0020
0.0027
0.0060
0.0066
0.0067
0.0014
0.0166
0.0067
0.0024
0.0072
0.0062
0.0081
0.0035
0.0077
0.0101
0.0045
0.0034
0.0144
0.0078
0.0065
0.0093
0.0181
0.0028
0.0050
0.0034
0.0063
0.0150
0.0035
0.0022
0.0079
0.0034
0.0110
0.0075
0.0058
0.0085
0.0152
0.0089
0.0060
0.0017
0.0041
0.0091
0.0072
-0.0109
0.0036
0.0063
0.0080
0.0037
0.0086
0.0097
0.0088
0.0016
0.0057
0.0059
0.0139
0.0061
0.0009
0.0059
0.0126
0.0117
0.0003
0.0060
0.0075
0.0073
0.0080
0.0154
0.0136
0.0121
0.0179
0.0150
0.0125
Instead of doing
f_filter = cconv(gf,f,length(f));
this does the trick:
f_filter = conv(gf,f);
f_filter = f_filter(sz/2+1:end-sz/2+1);
As suggested by #AnderBiguri you can use the option 'same' in your convolution fonction to preserve the original size of your array.
But if you apply a convolution with your normalized gaussian filter gf you will obtain a border effect.
To avoid the border effect you can apply the following tricks:
gf = exp(-x .^ 2 / (2 * sigma ^ 2)); %do not normalize gf now
f_filter = conv(f,gf,'same')./conv(ones(length(f),1),gf,'same') %normalization taking into account the lenght of the convolution
For example I've just transformed f into f = f+3
If we do not take into account the border effect we will obtain:

Matlab data sampler that weights the outputs to binary (0,1)

a sample probability matrix:
ans =
0.1444 0.0456 0.0138 0.0126 0.0116 0.0107 0.0052
0.1444 0.0456 0.0138 0.0126 0.0116 0.0107 0.0052
0.1222 0.0386 0.0116 0.0106 0.0098 0.0091 0.0044
0.1444 0.0456 0.0138 0.0126 0.0116 0.0107 0.0052
0.1222 0.0386 0.0116 0.0106 0.0098 0.0091 0.0044
0.1889 0.0596 0.0180 0.0164 0.0151 0.0140 0.0067
0.1333 0.0421 0.0127 0.0116 0.0107 0.0099 0.0048
I have used dataSample and randSample to sample 128 time from my data which has A=(7,7) size in matlab:
datasample(A,128)
ans =
0.1333 0.0421 0.0127 0.0116 0.0107 0.0099 0.0048
0.1222 0.0386 0.0116 0.0106 0.0098 0.0091 0.0044
0.1889 0.0596 0.0180 0.0164 0.0151 0.0140 0.0067
0.1889 0.0596 0.0180 0.0164 0.0151 0.0140 0.0067
0.1333 0.0421 0.0127 0.0116 0.0107 0.0099 0.0048
0.1444 0.0456 0.0138 0.0126 0.0116 0.0107 0.0052
0.1222 0.0386 0.0116 0.0106 0.0098 0.0091 0.0044
...
However, I am interested in having those 128 sample of 7 (128,7) in binary format with two discrete values of 0 and 1:
[1 1 1 0 1 0 1]
I can write a loop and round-down/up those values to 0 and 1 with certain thresholds (i.e. 0.5), but that for sure will be noisy. Is there a function that can output the sampling in binary (0,1) in Matlab ?

Different results in gaussian smoothing when filtering in time / frequency domain

I'm implementing a gaussian smoothing filter on c++ by point wise multiplication in frequency space. To check that my results were correct, I implemented the same code in matlab and compared it to matlab's built in filtering function.
Here's the check:
% Gauss kernel, sigma = 1.
gaussfilter = fspecial('gaussian',[11 11], 1);
% Test matrix
testmatrix = ones(11);
testmatrix(6,6) = 5;
% FFT, pointwise multiplication in freq. space, and reverse FFT
testmatrix1 = fftshift(fftn(ifftshift(testmatrix),[]));
testmatrix1 = testmatrix1 .* gaussfilter;
testmatrix1 = fftshift(ifftn(ifftshift(testmatrix1),[],'nonsymmetric'));
abs(testmatrix1) % expect equal to c++
% Check that matlab is doing the same..
testmatrix2 = imfilter(testmatrix, gaussfilter);
abs(testmatrix2) % expect equal to testmatrix1
To my surprise, I see that matlab's imfilter is returning something different. testmatrix2 is not the same as testmatrix1.
Why should this be the case? Is there something wrong with my understanding of filters, or am I calling imfilter incorrectly? (flagging imfilter with 'replicate', or 'conv' doesn't solve my problem).
Here are both matrices:
testmatrix1 =
0.1592 0.1592 0.1593 0.1595 0.1597 0.1598 0.1597 0.1595 0.1593 0.1592 0.1592
0.1592 0.1593 0.1597 0.1604 0.1612 0.1616 0.1612 0.1604 0.1597 0.1593 0.1592
0.1593 0.1597 0.1609 0.1631 0.1656 0.1668 0.1656 0.1631 0.1609 0.1597 0.1593
0.1595 0.1604 0.1631 0.1681 0.1738 0.1764 0.1738 0.1681 0.1631 0.1604 0.1595
0.1597 0.1612 0.1656 0.1738 0.1830 0.1872 0.1830 0.1738 0.1656 0.1612 0.1597
0.1598 0.1616 0.1668 0.1764 0.1872 0.1922 0.1872 0.1764 0.1668 0.1616 0.1598
0.1597 0.1612 0.1656 0.1738 0.1830 0.1872 0.1830 0.1738 0.1656 0.1612 0.1597
0.1595 0.1604 0.1631 0.1681 0.1738 0.1764 0.1738 0.1681 0.1631 0.1604 0.1595
0.1593 0.1597 0.1609 0.1631 0.1656 0.1668 0.1656 0.1631 0.1609 0.1597 0.1593
0.1592 0.1593 0.1597 0.1604 0.1612 0.1616 0.1612 0.1604 0.1597 0.1593 0.1592
0.1592 0.1592 0.1593 0.1595 0.1597 0.1598 0.1597 0.1595 0.1593 0.1592 0.1592
testmatrix2 =
0.4893 0.6585 0.6963 0.6994 0.6995 0.6995 0.6995 0.6994 0.6963 0.6585 0.4893
0.6585 0.8863 0.9371 0.9413 0.9416 0.9417 0.9416 0.9413 0.9371 0.8863 0.6585
0.6963 0.9371 0.9910 0.9963 0.9997 1.0025 0.9997 0.9963 0.9910 0.9371 0.6963
0.6994 0.9413 0.9963 1.0114 1.0521 1.0860 1.0521 1.0114 0.9963 0.9413 0.6994
0.6995 0.9416 0.9997 1.0521 1.2342 1.3861 1.2342 1.0521 0.9997 0.9416 0.6995
0.6995 0.9417 1.0025 1.0860 1.3861 1.6366 1.3861 1.0860 1.0025 0.9417 0.6995
0.6995 0.9416 0.9997 1.0521 1.2342 1.3861 1.2342 1.0521 0.9997 0.9416 0.6995
0.6994 0.9413 0.9963 1.0114 1.0521 1.0860 1.0521 1.0114 0.9963 0.9413 0.6994
0.6963 0.9371 0.9910 0.9963 0.9997 1.0025 0.9997 0.9963 0.9910 0.9371 0.6963
0.6585 0.8863 0.9371 0.9413 0.9416 0.9417 0.9416 0.9413 0.9371 0.8863 0.6585
0.4893 0.6585 0.6963 0.6994 0.6995 0.6995 0.6995 0.6994 0.6963 0.6585 0.4893
Ok, I found the issue.
I just had to take the FFT of gaussfilter before multiplying it with testmatrix1, and pass the flag 'replicate' to imfilter.
Changes:
testmatrix1 = testmatrix1 .* fftshift(fftn(ifftshift(gaussfilter),[]));
and
testmatrix2 = imfilter(testmatrix, gaussfilter,'replicate');

How does MATLAB connect 3d points?

I want to create a rocket shape by specifying a "cloud" of surface points and making MATLAB connect the points into rectangular patches (such that when there are many of these, it creates the illusion of a curved surface). How can I make MATLAB do this? I.e. in what order must I specify the points in order to make MATLAB patch them together correctly?
Here is what I have so far:
The above is using plot3; what I have is a long matrix of the following structure:
[x1 y1 z1
x2 y2 z2
.
.
.]
I would like to know how to make this into a surface. The full matrix is:
-0.2470 0.0380 0
-0.2470 0.0374 0.0066
-0.2470 0.0357 0.0130
-0.2470 0.0329 0.0190
-0.2470 0.0291 0.0244
-0.2470 0.0244 0.0291
-0.2470 0.0190 0.0329
-0.2470 0.0130 0.0357
-0.2470 0.0066 0.0374
-0.2470 0.0000 0.0380
-0.2470 -0.0066 0.0374
-0.2470 -0.0130 0.0357
-0.2470 -0.0190 0.0329
-0.2470 -0.0244 0.0291
-0.2470 -0.0291 0.0244
-0.2470 -0.0329 0.0190
-0.2470 -0.0357 0.0130
-0.2470 -0.0374 0.0066
-0.2470 -0.0380 0.0000
-0.2470 -0.0374 -0.0066
-0.2470 -0.0357 -0.0130
-0.2470 -0.0329 -0.0190
-0.2470 -0.0291 -0.0244
-0.2470 -0.0244 -0.0291
-0.2470 -0.0190 -0.0329
-0.2470 -0.0130 -0.0357
-0.2470 -0.0066 -0.0374
-0.2470 -0.0000 -0.0380
-0.2470 0.0066 -0.0374
-0.2470 0.0130 -0.0357
-0.2470 0.0190 -0.0329
-0.2470 0.0244 -0.0291
-0.2470 0.0291 -0.0244
-0.2470 0.0329 -0.0190
-0.2470 0.0357 -0.0130
-0.2470 0.0374 -0.0066
-0.1970 0.0380 0
-0.1970 0.0374 0.0066
-0.1970 0.0357 0.0130
-0.1970 0.0329 0.0190
-0.1970 0.0291 0.0244
-0.1970 0.0244 0.0291
-0.1970 0.0190 0.0329
-0.1970 0.0130 0.0357
-0.1970 0.0066 0.0374
-0.1970 0.0000 0.0380
-0.1970 -0.0066 0.0374
-0.1970 -0.0130 0.0357
-0.1970 -0.0190 0.0329
-0.1970 -0.0244 0.0291
-0.1970 -0.0291 0.0244
-0.1970 -0.0329 0.0190
-0.1970 -0.0357 0.0130
-0.1970 -0.0374 0.0066
-0.1970 -0.0380 0.0000
-0.1970 -0.0374 -0.0066
-0.1970 -0.0357 -0.0130
-0.1970 -0.0329 -0.0190
-0.1970 -0.0291 -0.0244
-0.1970 -0.0244 -0.0291
-0.1970 -0.0190 -0.0329
-0.1970 -0.0130 -0.0357
-0.1970 -0.0066 -0.0374
-0.1970 -0.0000 -0.0380
-0.1970 0.0066 -0.0374
-0.1970 0.0130 -0.0357
-0.1970 0.0190 -0.0329
-0.1970 0.0244 -0.0291
-0.1970 0.0291 -0.0244
-0.1970 0.0329 -0.0190
-0.1970 0.0357 -0.0130
-0.1970 0.0374 -0.0066
-0.1470 0.0380 0
-0.1470 0.0374 0.0066
-0.1470 0.0357 0.0130
-0.1470 0.0329 0.0190
-0.1470 0.0291 0.0244
-0.1470 0.0244 0.0291
-0.1470 0.0190 0.0329
-0.1470 0.0130 0.0357
-0.1470 0.0066 0.0374
-0.1470 0.0000 0.0380
-0.1470 -0.0066 0.0374
-0.1470 -0.0130 0.0357
-0.1470 -0.0190 0.0329
-0.1470 -0.0244 0.0291
-0.1470 -0.0291 0.0244
-0.1470 -0.0329 0.0190
-0.1470 -0.0357 0.0130
-0.1470 -0.0374 0.0066
-0.1470 -0.0380 0.0000
-0.1470 -0.0374 -0.0066
-0.1470 -0.0357 -0.0130
-0.1470 -0.0329 -0.0190
-0.1470 -0.0291 -0.0244
-0.1470 -0.0244 -0.0291
-0.1470 -0.0190 -0.0329
-0.1470 -0.0130 -0.0357
-0.1470 -0.0066 -0.0374
-0.1470 -0.0000 -0.0380
-0.1470 0.0066 -0.0374
-0.1470 0.0130 -0.0357
-0.1470 0.0190 -0.0329
-0.1470 0.0244 -0.0291
-0.1470 0.0291 -0.0244
-0.1470 0.0329 -0.0190
-0.1470 0.0357 -0.0130
-0.1470 0.0374 -0.0066
-0.0970 0.0380 0
-0.0970 0.0374 0.0066
-0.0970 0.0357 0.0130
-0.0970 0.0329 0.0190
-0.0970 0.0291 0.0244
-0.0970 0.0244 0.0291
-0.0970 0.0190 0.0329
-0.0970 0.0130 0.0357
-0.0970 0.0066 0.0374
-0.0970 0.0000 0.0380
-0.0970 -0.0066 0.0374
-0.0970 -0.0130 0.0357
-0.0970 -0.0190 0.0329
-0.0970 -0.0244 0.0291
-0.0970 -0.0291 0.0244
-0.0970 -0.0329 0.0190
-0.0970 -0.0357 0.0130
-0.0970 -0.0374 0.0066
-0.0970 -0.0380 0.0000
-0.0970 -0.0374 -0.0066
-0.0970 -0.0357 -0.0130
-0.0970 -0.0329 -0.0190
-0.0970 -0.0291 -0.0244
-0.0970 -0.0244 -0.0291
-0.0970 -0.0190 -0.0329
-0.0970 -0.0130 -0.0357
-0.0970 -0.0066 -0.0374
-0.0970 -0.0000 -0.0380
-0.0970 0.0066 -0.0374
-0.0970 0.0130 -0.0357
-0.0970 0.0190 -0.0329
-0.0970 0.0244 -0.0291
-0.0970 0.0291 -0.0244
-0.0970 0.0329 -0.0190
-0.0970 0.0357 -0.0130
-0.0970 0.0374 -0.0066
-0.0470 0.0380 0
-0.0470 0.0374 0.0066
-0.0470 0.0357 0.0130
-0.0470 0.0329 0.0190
-0.0470 0.0291 0.0244
-0.0470 0.0244 0.0291
-0.0470 0.0190 0.0329
-0.0470 0.0130 0.0357
-0.0470 0.0066 0.0374
-0.0470 0.0000 0.0380
-0.0470 -0.0066 0.0374
-0.0470 -0.0130 0.0357
-0.0470 -0.0190 0.0329
-0.0470 -0.0244 0.0291
-0.0470 -0.0291 0.0244
-0.0470 -0.0329 0.0190
-0.0470 -0.0357 0.0130
-0.0470 -0.0374 0.0066
-0.0470 -0.0380 0.0000
-0.0470 -0.0374 -0.0066
-0.0470 -0.0357 -0.0130
-0.0470 -0.0329 -0.0190
-0.0470 -0.0291 -0.0244
-0.0470 -0.0244 -0.0291
-0.0470 -0.0190 -0.0329
-0.0470 -0.0130 -0.0357
-0.0470 -0.0066 -0.0374
-0.0470 -0.0000 -0.0380
-0.0470 0.0066 -0.0374
-0.0470 0.0130 -0.0357
-0.0470 0.0190 -0.0329
-0.0470 0.0244 -0.0291
-0.0470 0.0291 -0.0244
-0.0470 0.0329 -0.0190
-0.0470 0.0357 -0.0130
-0.0470 0.0374 -0.0066
0.0030 0.0380 0
0.0030 0.0374 0.0066
0.0030 0.0357 0.0130
0.0030 0.0329 0.0190
0.0030 0.0291 0.0244
0.0030 0.0244 0.0291
0.0030 0.0190 0.0329
0.0030 0.0130 0.0357
0.0030 0.0066 0.0374
0.0030 0.0000 0.0380
0.0030 -0.0066 0.0374
0.0030 -0.0130 0.0357
0.0030 -0.0190 0.0329
0.0030 -0.0244 0.0291
0.0030 -0.0291 0.0244
0.0030 -0.0329 0.0190
0.0030 -0.0357 0.0130
0.0030 -0.0374 0.0066
0.0030 -0.0380 0.0000
0.0030 -0.0374 -0.0066
0.0030 -0.0357 -0.0130
0.0030 -0.0329 -0.0190
0.0030 -0.0291 -0.0244
0.0030 -0.0244 -0.0291
0.0030 -0.0190 -0.0329
0.0030 -0.0130 -0.0357
0.0030 -0.0066 -0.0374
0.0030 -0.0000 -0.0380
0.0030 0.0066 -0.0374
0.0030 0.0130 -0.0357
0.0030 0.0190 -0.0329
0.0030 0.0244 -0.0291
0.0030 0.0291 -0.0244
0.0030 0.0329 -0.0190
0.0030 0.0357 -0.0130
0.0030 0.0374 -0.0066
0.0530 0.0380 0
0.0530 0.0374 0.0066
0.0530 0.0357 0.0130
0.0530 0.0329 0.0190
0.0530 0.0291 0.0244
0.0530 0.0244 0.0291
0.0530 0.0190 0.0329
0.0530 0.0130 0.0357
0.0530 0.0066 0.0374
0.0530 0.0000 0.0380
0.0530 -0.0066 0.0374
0.0530 -0.0130 0.0357
0.0530 -0.0190 0.0329
0.0530 -0.0244 0.0291
0.0530 -0.0291 0.0244
0.0530 -0.0329 0.0190
0.0530 -0.0357 0.0130
0.0530 -0.0374 0.0066
0.0530 -0.0380 0.0000
0.0530 -0.0374 -0.0066
0.0530 -0.0357 -0.0130
0.0530 -0.0329 -0.0190
0.0530 -0.0291 -0.0244
0.0530 -0.0244 -0.0291
0.0530 -0.0190 -0.0329
0.0530 -0.0130 -0.0357
0.0530 -0.0066 -0.0374
0.0530 -0.0000 -0.0380
0.0530 0.0066 -0.0374
0.0530 0.0130 -0.0357
0.0530 0.0190 -0.0329
0.0530 0.0244 -0.0291
0.0530 0.0291 -0.0244
0.0530 0.0329 -0.0190
0.0530 0.0357 -0.0130
0.0530 0.0374 -0.0066
0.1030 0.0380 0
0.1030 0.0374 0.0066
0.1030 0.0357 0.0130
0.1030 0.0329 0.0190
0.1030 0.0291 0.0244
0.1030 0.0244 0.0291
0.1030 0.0190 0.0329
0.1030 0.0130 0.0357
0.1030 0.0066 0.0374
0.1030 0.0000 0.0380
0.1030 -0.0066 0.0374
0.1030 -0.0130 0.0357
0.1030 -0.0190 0.0329
0.1030 -0.0244 0.0291
0.1030 -0.0291 0.0244
0.1030 -0.0329 0.0190
0.1030 -0.0357 0.0130
0.1030 -0.0374 0.0066
0.1030 -0.0380 0.0000
0.1030 -0.0374 -0.0066
0.1030 -0.0357 -0.0130
0.1030 -0.0329 -0.0190
0.1030 -0.0291 -0.0244
0.1030 -0.0244 -0.0291
0.1030 -0.0190 -0.0329
0.1030 -0.0130 -0.0357
0.1030 -0.0066 -0.0374
0.1030 -0.0000 -0.0380
0.1030 0.0066 -0.0374
0.1030 0.0130 -0.0357
0.1030 0.0190 -0.0329
0.1030 0.0244 -0.0291
0.1030 0.0291 -0.0244
0.1030 0.0329 -0.0190
0.1030 0.0357 -0.0130
0.1030 0.0374 -0.0066
0.1530 0.0380 0
0.1530 0.0374 0.0066
0.1530 0.0357 0.0130
0.1530 0.0329 0.0190
0.1530 0.0291 0.0244
0.1530 0.0244 0.0291
0.1530 0.0190 0.0329
0.1530 0.0130 0.0357
0.1530 0.0066 0.0374
0.1530 0.0000 0.0380
0.1530 -0.0066 0.0374
0.1530 -0.0130 0.0357
0.1530 -0.0190 0.0329
0.1530 -0.0244 0.0291
0.1530 -0.0291 0.0244
0.1530 -0.0329 0.0190
0.1530 -0.0357 0.0130
0.1530 -0.0374 0.0066
0.1530 -0.0380 0.0000
0.1530 -0.0374 -0.0066
0.1530 -0.0357 -0.0130
0.1530 -0.0329 -0.0190
0.1530 -0.0291 -0.0244
0.1530 -0.0244 -0.0291
0.1530 -0.0190 -0.0329
0.1530 -0.0130 -0.0357
0.1530 -0.0066 -0.0374
0.1530 -0.0000 -0.0380
0.1530 0.0066 -0.0374
0.1530 0.0130 -0.0357
0.1530 0.0190 -0.0329
0.1530 0.0244 -0.0291
0.1530 0.0291 -0.0244
0.1530 0.0329 -0.0190
0.1530 0.0357 -0.0130
0.1530 0.0374 -0.0066
0.2030 0.0380 0
0.2030 0.0374 0.0066
0.2030 0.0357 0.0130
0.2030 0.0329 0.0190
0.2030 0.0291 0.0244
0.2030 0.0244 0.0291
0.2030 0.0190 0.0329
0.2030 0.0130 0.0357
0.2030 0.0066 0.0374
0.2030 0.0000 0.0380
0.2030 -0.0066 0.0374
0.2030 -0.0130 0.0357
0.2030 -0.0190 0.0329
0.2030 -0.0244 0.0291
0.2030 -0.0291 0.0244
0.2030 -0.0329 0.0190
0.2030 -0.0357 0.0130
0.2030 -0.0374 0.0066
0.2030 -0.0380 0.0000
0.2030 -0.0374 -0.0066
0.2030 -0.0357 -0.0130
0.2030 -0.0329 -0.0190
0.2030 -0.0291 -0.0244
0.2030 -0.0244 -0.0291
0.2030 -0.0190 -0.0329
0.2030 -0.0130 -0.0357
0.2030 -0.0066 -0.0374
0.2030 -0.0000 -0.0380
0.2030 0.0066 -0.0374
0.2030 0.0130 -0.0357
0.2030 0.0190 -0.0329
0.2030 0.0244 -0.0291
0.2030 0.0291 -0.0244
0.2030 0.0329 -0.0190
0.2030 0.0357 -0.0130
0.2030 0.0374 -0.0066
0.2530 0.0380 0
0.2530 0.0374 0.0066
0.2530 0.0357 0.0130
0.2530 0.0329 0.0190
0.2530 0.0291 0.0244
0.2530 0.0244 0.0291
0.2530 0.0190 0.0329
0.2530 0.0130 0.0357
0.2530 0.0066 0.0374
0.2530 0.0000 0.0380
0.2530 -0.0066 0.0374
0.2530 -0.0130 0.0357
0.2530 -0.0190 0.0329
0.2530 -0.0244 0.0291
0.2530 -0.0291 0.0244
0.2530 -0.0329 0.0190
0.2530 -0.0357 0.0130
0.2530 -0.0374 0.0066
0.2530 -0.0380 0.0000
0.2530 -0.0374 -0.0066
0.2530 -0.0357 -0.0130
0.2530 -0.0329 -0.0190
0.2530 -0.0291 -0.0244
0.2530 -0.0244 -0.0291
0.2530 -0.0190 -0.0329
0.2530 -0.0130 -0.0357
0.2530 -0.0066 -0.0374
0.2530 -0.0000 -0.0380
0.2530 0.0066 -0.0374
0.2530 0.0130 -0.0357
0.2530 0.0190 -0.0329
0.2530 0.0244 -0.0291
0.2530 0.0291 -0.0244
0.2530 0.0329 -0.0190
0.2530 0.0357 -0.0130
0.2530 0.0374 -0.0066
0.3030 0.0380 0
0.3030 0.0374 0.0066
0.3030 0.0357 0.0130
0.3030 0.0329 0.0190
0.3030 0.0291 0.0244
0.3030 0.0244 0.0291
0.3030 0.0190 0.0329
0.3030 0.0130 0.0357
0.3030 0.0066 0.0374
0.3030 0.0000 0.0380
0.3030 -0.0066 0.0374
0.3030 -0.0130 0.0357
0.3030 -0.0190 0.0329
0.3030 -0.0244 0.0291
0.3030 -0.0291 0.0244
0.3030 -0.0329 0.0190
0.3030 -0.0357 0.0130
0.3030 -0.0374 0.0066
0.3030 -0.0380 0.0000
0.3030 -0.0374 -0.0066
0.3030 -0.0357 -0.0130
0.3030 -0.0329 -0.0190
0.3030 -0.0291 -0.0244
0.3030 -0.0244 -0.0291
0.3030 -0.0190 -0.0329
0.3030 -0.0130 -0.0357
0.3030 -0.0066 -0.0374
0.3030 -0.0000 -0.0380
0.3030 0.0066 -0.0374
0.3030 0.0130 -0.0357
0.3030 0.0190 -0.0329
0.3030 0.0244 -0.0291
0.3030 0.0291 -0.0244
0.3030 0.0329 -0.0190
0.3030 0.0357 -0.0130
0.3030 0.0374 -0.0066
0.3530 0.0380 0
0.3530 0.0374 0.0066
0.3530 0.0357 0.0130
0.3530 0.0329 0.0190
0.3530 0.0291 0.0244
0.3530 0.0244 0.0291
0.3530 0.0190 0.0329
0.3530 0.0130 0.0357
0.3530 0.0066 0.0374
0.3530 0.0000 0.0380
0.3530 -0.0066 0.0374
0.3530 -0.0130 0.0357
0.3530 -0.0190 0.0329
0.3530 -0.0244 0.0291
0.3530 -0.0291 0.0244
0.3530 -0.0329 0.0190
0.3530 -0.0357 0.0130
0.3530 -0.0374 0.0066
0.3530 -0.0380 0.0000
0.3530 -0.0374 -0.0066
0.3530 -0.0357 -0.0130
0.3530 -0.0329 -0.0190
0.3530 -0.0291 -0.0244
0.3530 -0.0244 -0.0291
0.3530 -0.0190 -0.0329
0.3530 -0.0130 -0.0357
0.3530 -0.0066 -0.0374
0.3530 -0.0000 -0.0380
0.3530 0.0066 -0.0374
0.3530 0.0130 -0.0357
0.3530 0.0190 -0.0329
0.3530 0.0244 -0.0291
0.3530 0.0291 -0.0244
0.3530 0.0329 -0.0190
0.3530 0.0357 -0.0130
0.3530 0.0374 -0.0066
0.4030 0.0380 0
0.4030 0.0374 0.0066
0.4030 0.0357 0.0130
0.4030 0.0329 0.0190
0.4030 0.0291 0.0244
0.4030 0.0244 0.0291
0.4030 0.0190 0.0329
0.4030 0.0130 0.0357
0.4030 0.0066 0.0374
0.4030 0.0000 0.0380
0.4030 -0.0066 0.0374
0.4030 -0.0130 0.0357
0.4030 -0.0190 0.0329
0.4030 -0.0244 0.0291
0.4030 -0.0291 0.0244
0.4030 -0.0329 0.0190
0.4030 -0.0357 0.0130
0.4030 -0.0374 0.0066
0.4030 -0.0380 0.0000
0.4030 -0.0374 -0.0066
0.4030 -0.0357 -0.0130
0.4030 -0.0329 -0.0190
0.4030 -0.0291 -0.0244
0.4030 -0.0244 -0.0291
0.4030 -0.0190 -0.0329
0.4030 -0.0130 -0.0357
0.4030 -0.0066 -0.0374
0.4030 -0.0000 -0.0380
0.4030 0.0066 -0.0374
0.4030 0.0130 -0.0357
0.4030 0.0190 -0.0329
0.4030 0.0244 -0.0291
0.4030 0.0291 -0.0244
0.4030 0.0329 -0.0190
0.4030 0.0357 -0.0130
0.4030 0.0374 -0.0066
0.4530 0.0380 0
0.4530 0.0374 0.0066
0.4530 0.0357 0.0130
0.4530 0.0329 0.0190
0.4530 0.0291 0.0244
0.4530 0.0244 0.0291
0.4530 0.0190 0.0329
0.4530 0.0130 0.0357
0.4530 0.0066 0.0374
0.4530 0.0000 0.0380
0.4530 -0.0066 0.0374
0.4530 -0.0130 0.0357
0.4530 -0.0190 0.0329
0.4530 -0.0244 0.0291
0.4530 -0.0291 0.0244
0.4530 -0.0329 0.0190
0.4530 -0.0357 0.0130
0.4530 -0.0374 0.0066
0.4530 -0.0380 0.0000
0.4530 -0.0374 -0.0066
0.4530 -0.0357 -0.0130
0.4530 -0.0329 -0.0190
0.4530 -0.0291 -0.0244
0.4530 -0.0244 -0.0291
0.4530 -0.0190 -0.0329
0.4530 -0.0130 -0.0357
0.4530 -0.0066 -0.0374
0.4530 -0.0000 -0.0380
0.4530 0.0066 -0.0374
0.4530 0.0130 -0.0357
0.4530 0.0190 -0.0329
0.4530 0.0244 -0.0291
0.4530 0.0291 -0.0244
0.4530 0.0329 -0.0190
0.4530 0.0357 -0.0130
0.4530 0.0374 -0.0066
0.5030 0.0380 0
0.5030 0.0374 0.0066
0.5030 0.0357 0.0130
0.5030 0.0329 0.0190
0.5030 0.0291 0.0244
0.5030 0.0244 0.0291
0.5030 0.0190 0.0329
0.5030 0.0130 0.0357
0.5030 0.0066 0.0374
0.5030 0.0000 0.0380
0.5030 -0.0066 0.0374
0.5030 -0.0130 0.0357
0.5030 -0.0190 0.0329
0.5030 -0.0244 0.0291
0.5030 -0.0291 0.0244
0.5030 -0.0329 0.0190
0.5030 -0.0357 0.0130
0.5030 -0.0374 0.0066
0.5030 -0.0380 0.0000
0.5030 -0.0374 -0.0066
0.5030 -0.0357 -0.0130
0.5030 -0.0329 -0.0190
0.5030 -0.0291 -0.0244
0.5030 -0.0244 -0.0291
0.5030 -0.0190 -0.0329
0.5030 -0.0130 -0.0357
0.5030 -0.0066 -0.0374
0.5030 -0.0000 -0.0380
0.5030 0.0066 -0.0374
0.5030 0.0130 -0.0357
0.5030 0.0190 -0.0329
0.5030 0.0244 -0.0291
0.5030 0.0291 -0.0244
0.5030 0.0329 -0.0190
0.5030 0.0357 -0.0130
0.5030 0.0374 -0.0066
0.5530 0.0347 0
0.5530 0.0342 0.0060
0.5530 0.0326 0.0119
0.5530 0.0301 0.0174
0.5530 0.0266 0.0223
0.5530 0.0223 0.0266
0.5530 0.0174 0.0301
0.5530 0.0119 0.0326
0.5530 0.0060 0.0342
0.5530 0.0000 0.0347
0.5530 -0.0060 0.0342
0.5530 -0.0119 0.0326
0.5530 -0.0174 0.0301
0.5530 -0.0223 0.0266
0.5530 -0.0266 0.0223
0.5530 -0.0301 0.0174
0.5530 -0.0326 0.0119
0.5530 -0.0342 0.0060
0.5530 -0.0347 0.0000
0.5530 -0.0342 -0.0060
0.5530 -0.0326 -0.0119
0.5530 -0.0301 -0.0174
0.5530 -0.0266 -0.0223
0.5530 -0.0223 -0.0266
0.5530 -0.0174 -0.0301
0.5530 -0.0119 -0.0326
0.5530 -0.0060 -0.0342
0.5530 -0.0000 -0.0347
0.5530 0.0060 -0.0342
0.5530 0.0119 -0.0326
0.5530 0.0174 -0.0301
0.5530 0.0223 -0.0266
0.5530 0.0266 -0.0223
0.5530 0.0301 -0.0174
0.5530 0.0326 -0.0119
0.5530 0.0342 -0.0060
0.6030 0.0242 0
0.6030 0.0238 0.0042
0.6030 0.0227 0.0083
0.6030 0.0209 0.0121
0.6030 0.0185 0.0155
0.6030 0.0155 0.0185
0.6030 0.0121 0.0209
0.6030 0.0083 0.0227
0.6030 0.0042 0.0238
0.6030 0.0000 0.0242
0.6030 -0.0042 0.0238
0.6030 -0.0083 0.0227
0.6030 -0.0121 0.0209
0.6030 -0.0155 0.0185
0.6030 -0.0185 0.0155
0.6030 -0.0209 0.0121
0.6030 -0.0227 0.0083
0.6030 -0.0238 0.0042
0.6030 -0.0242 0.0000
0.6030 -0.0238 -0.0042
0.6030 -0.0227 -0.0083
0.6030 -0.0209 -0.0121
0.6030 -0.0185 -0.0155
0.6030 -0.0155 -0.0185
0.6030 -0.0121 -0.0209
0.6030 -0.0083 -0.0227
0.6030 -0.0042 -0.0238
0.6030 -0.0000 -0.0242
0.6030 0.0042 -0.0238
0.6030 0.0083 -0.0227
0.6030 0.0121 -0.0209
0.6030 0.0155 -0.0185
0.6030 0.0185 -0.0155
0.6030 0.0209 -0.0121
0.6030 0.0227 -0.0083
0.6030 0.0238 -0.0042
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
0.6530 0 0
MATLAB plots the points in the same order as the vector that you supply. For example,
plot3([x1 x2 x3], [y1 y2 y3], [z1 z2 z3])
will connect [x1 y1 z1] to [x2 y2 z2], and connect [x2 y2 z2] to [x3 y3 z3]. If you want to create a rocket shape that is composed of several curves, then you will need to use one plot3 command for each curve.

concatenate columns of matrix into one vector

suppose that we have following two random matrix
x=rand(7,7);
x
x =
0.8147 0.5469 0.8003 0.0357 0.6555 0.8235 0.7655
0.9058 0.9575 0.1419 0.8491 0.1712 0.6948 0.7952
0.1270 0.9649 0.4218 0.9340 0.7060 0.3171 0.1869
0.9134 0.1576 0.9157 0.6787 0.0318 0.9502 0.4898
0.6324 0.9706 0.7922 0.7577 0.2769 0.0344 0.4456
0.0975 0.9572 0.9595 0.7431 0.0462 0.4387 0.6463
0.2785 0.4854 0.6557 0.3922 0.0971 0.3816 0.7094
and
y=rand(6,5)
y =
0.7547 0.4984 0.2551 0.1386 0.2435
0.2760 0.9597 0.5060 0.1493 0.9293
0.6797 0.3404 0.6991 0.2575 0.3500
0.6551 0.5853 0.8909 0.8407 0.1966
0.1626 0.2238 0.9593 0.2543 0.2511
0.1190 0.7513 0.5472 0.8143 0.6160
i want to concatenate first four columns of each matrix into single one dimensional vector c,i have tried
c=[x(:,4) y(:,4)]
Error using horzcat
Dimensions of matrices being concatenated are not consistent.
but get following error,please help me to solve this problem
[ reshape(x(:,1:4),[],1); reshape(y(:,1:4),[],1) ]
This stacks one column below the other: first those of x and then those of y. I guess that's the element order you want. (If you want to interleave one column of x, then one of y etc, see #RobertP's comment.)