|
|
If condition for syntax find |
|
|
Verfasst am: 03.09.2013, 12:07
Titel: If condition for syntax find
|
 |
Hallo I have a matrix3*3 say A=zeros(3,3). Suppose say each row is represented as 1,2,3
I have another matrix i.e if i say B=[2,3]. My code generates 1*3 matrix for 2 and 3.
let us say that matrix a1=[1 1 0] a2=[0 0 1]. then my code replaces this values in A. now my new matrix A=[0 0 0;1 1 0;0 0 1]
every thing is fine . Now i have a problem i.e If i say B=[3,4,5] where 4,5 are not representing A(because in A the rows are represented by 1,2,3). so now i need to get new matrix as A=[0 00;0 0 0;0 01] (since for 3 the generated row matrix a2=[0 01])
please could any one help in this
|
|
|
|
|
Winkow |

Moderator
|
 |
Beiträge: 3.842
|
 |
|
 |
Anmeldedatum: 04.11.11
|
 |
|
 |
Wohnort: Dresden
|
 |
|
 |
Version: R2014a 2015a
|
 |
|
|
 |
|
Verfasst am: 03.09.2013, 12:13
Titel:
|
 |
please use the code environment and post code instead of trying to discribe it in your own words. its much easyer to understand code.
you could check the size of A and then only use elements of B that is smaller then the size of A
_________________
richtig Fragen
|
|
|
|
Verfasst am: 03.09.2013, 12:56
Titel:
|
 |
thank you Winkow but it is not working
Here is a part of my code
Zuletzt bearbeitet von prudhvi_kumar_b@yahoo.com am 03.09.2013, 13:02, insgesamt einmal bearbeitet
|
|
|
Winkow |

Moderator
|
 |
Beiträge: 3.842
|
 |
|
 |
Anmeldedatum: 04.11.11
|
 |
|
 |
Wohnort: Dresden
|
 |
|
 |
Version: R2014a 2015a
|
 |
|
|
 |
|
Verfasst am: 03.09.2013, 13:02
Titel:
|
 |
i can only repeat myself ^^ please use the code environment.
this code ist not what you discribed top i think but thats y code is better then words.
_________________
richtig Fragen
|
|
|
|
Verfasst am: 03.09.2013, 13:10
Titel:
|
 |
Awesome its working
Thank you very much winkow
|
|
|
|
|
Einstellungen und Berechtigungen
|
|
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
|
|
Impressum
| Nutzungsbedingungen
| Datenschutz
| FAQ
| RSS
Hosted by:
Copyright © 2007 - 2025
goMatlab.de | Dies ist keine offizielle Website der Firma The Mathworks
MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.
|
|