how to create a matrix from existing matrix
Mostrar comentarios más antiguos
I have matrix A and need to create matrix B. Please let me know how to do it Sample: if true
A B
0.25 0
0.25
0.50
0.75
1
0.20 1.20
1.40
1.60
1.80
2
0.15 2.15
2.30
2.45
2.60
2.85
3
0.20 3.20
3.40
3.60
3.80
4
0.10 4.10
4.20
4.30
4.40
4.50
4.60
4.70
4.80
4.90
5
- -
- -
- -
1 comentario
Azzi Abdelmalek
el 19 de Feb. de 2013
What is the relation between A and B?
Why for .2 there is 5 values and for 0.15 there is 6?
Respuesta aceptada
Más respuestas (1)
Azzi Abdelmalek
el 19 de Feb. de 2013
A=[0.25 0.2 .15 .2 .1]
a=cell2mat(arrayfun(@(x) x+A(x)-1:A(x):x,1:numel(A),'un', 0 ))'
1 comentario
shanmukh
el 20 de Feb. de 2013
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!