Respondida
How can I select a .m file through browser push button option in GUI and add/save that file in my current Matlab working directory ? Any guidance is appreciated.TIA
[file,path] = uigetfile('*.m','Choose file to save'); copyfile([path file], pwd)

más de 9 años hace | 0

| aceptada

Respondida
how to add elements in matrix
a = [2 6; 5 6]; result = sum(a');

más de 9 años hace | 1

Respondida
Connect two blocks in a subsytem
Hi Nedra, I couldn't load the image you have attached. You could give this a try: add_line('Mtest/Subsystem', 'Logical O...

más de 9 años hace | 0

Respondida
Need help to create matlab script to convert currency
Here is function for it : you can easily convert to a script if you want. function currencyTable = convertCurrency(toUsd, t...

más de 9 años hace | 0

Respondida
how to find differences in two simulink configuration settings using m-script
You can return a variable if you run the function 'active_config' after you have saved it as mentioned in the question. >> ...

más de 9 años hace | 0

| aceptada

Respondida
Modifying discrete filter block simulink
Hi Adam, If you're trying to modify the sample time from the command prompt, this api might be helpful: >> load_system('...

más de 9 años hace | 0

| aceptada

Respondida
List of structures as input to getfield()?
First Argument of 'getfield' should be a struct. `myStructList(i).name` probably refers to a char type variable. If myStruct...

más de 9 años hace | 0

Respondida
For-loop in Matlab
You don't even need a for loop c = 1:10; x = sind(c);

más de 9 años hace | 1

Respondida
double for loop with changing start point at second loop. need help, wrong output.
n = 10; result = zeros(n,n-1); for N1=1:1:(n-1) for N2=(N1+1):1:n result(N2,N1) = N2+N1; end ...

más de 9 años hace | 0

| aceptada

Respondida
How can I find duplicate sub systems in model using m-script
This below code should work for reasonably simple subsystems. I haven't tried for any complex ones - like with triggered input. ...

más de 9 años hace | 0

| aceptada

Respondida
M script: How to find which block is connected to which block?
>> load_system(myModel); >> allBlks = find_system(myModel, 'Type', 'block') Now this will give you all the blocks in the...

más de 9 años hace | 3

| aceptada

Respondida
find a row with a column value don't remove duplicated cells
for j=1, it is trying to access data1{0,1} but matlab indexing starts from 1.

más de 9 años hace | 0

| aceptada

Respondida
Creating a surface plot using Simulink?
Hi Vokler, if you already have designed the simulink model, you could simply use load_system and sim to get the output.

más de 9 años hace | 0

Respondida
Hello, i need the values in simulink..
From what I understand, you are trying to save the output of the simulation in an excel file, in place of viewing in the scope. ...

más de 9 años hace | 0

Respondida
About fixing a script
You have an error in 'mat2cell' function call in line 45 of your script. Please see the documentation to get more information on...

más de 9 años hace | 0

| aceptada

Respondida
creating a new vector relative to the matrix
% A = your 10x6 original matrix; uRows = unique(A, 'rows'); result = zeros(6,1); for i=1:size(uRows, 1) ...

más de 9 años hace | 0

| aceptada

Respondida
Singleton for database connection: availability problem
I became intrigued and scribbled something on my own. I guess you already know this stuff: classdef (Sealed) MyDBConnection...

más de 9 años hace | 0

Respondida
replace the string a cell array with empty cell
You may directly use the strrep function a = strrep(a, 'def', '');

más de 9 años hace | 0

| aceptada

Respondida
matrix with elements sum of elements of old matrix
This would work, but maybe there's a better solution. a = [3 4 2 5]; a_new = a(1:end-1); a_new(end) = a_new(end) + a(...

más de 9 años hace | 1

Respondida
pls i need ful information and steps on how to use matlab to plot sin wave curve
You could find an example in the matlab documentation for plot function. >> doc plot

más de 9 años hace | 0

Respondida
computing first 50 terms of sequence
Keeping your code intact for most of the part, this is a quick fix x = zeros(2,50); x(:,1) = [1;0]; A = [1.52 -.7; .5...

más de 9 años hace | 0

| aceptada

Respondida
picking data from excel
matlab provides an extensive documentation on xlsread. Please try and see if this helps doc xlsread

más de 9 años hace | 0

| aceptada

Respondida
Contain outputs of function in one table(?)
1. If your output variables all have equal number of rows, you indeed can use a 'table' datatype. doc table 2. Otherwise...

más de 9 años hace | 1

| aceptada

Respondida
How to replace data in a matrix by comparing from another matrix?
Assuming, the 'a' matrix has unique values in the first column for bRow= 1:size(b, 1) aRow = find(a(:,1)==b(bRow,1),...

más de 9 años hace | 1

Respondida
How do I loop through incrementally changing values
You could utilize the colon and element-wise operators, instead of looping. For example: alpha = 1:0.5:20; a = 0.1 + ...

más de 9 años hace | 0

Respondida
How do i create two multi-dimensional arrays:  a 10 x 10 x 10 numerical array (3-D) anda 5 x 5 x 5 x 5 numerical array (4-D) where each value in each array corresponds to the multiplication of indices?
This could be another approach: A = ones(10, 10, 10); for i=1:10 A(i,:,:) = A(i,:,:)*i; A(:,i,:) = A(:,i,:)*i;...

más de 9 años hace | 2

| aceptada

Respondida
Color maps and for loops
I guess, this is what you're looking for: myMap = zeros(4,3); for i=1:4 myMap(i,1) = i/4; end firstCo...

más de 9 años hace | 0

| aceptada

Respondida
add the particular column in the for loop
Are you looking for something like this? dataMatrix = [1 2 3; 4 5 6; 7 8 9]; outPut = zeros(size(dataMatrix,2),1); ...

más de 9 años hace | 0

Respondida
While loop for a menu
In my opinion, the proper way of doing this would be - using call-back functions. Please have a look if this documentation helps...

más de 9 años hace | 0

| aceptada

Cargar más