Answered
Sharing data among two of more GUI
Similar questions have been asked again and again. See <http://www.mathworks.com/matlabcentral/answers/12355-simple-button this ...

15 years ago | 0

Answered
how to take the non zero values from one matrix and put them in another??
B=A(A~=0);

15 years ago | 1

| accepted

Answered
read data from different rows
There are many ways. You can use textscan() to read line by line so you can skip any line you want. If the file is not huge, y...

15 years ago | 0

Answered
excel& matlab
Looks like you can use the built-in function xlsread(). It can read a single sheet or a single cell. help xlsread

15 years ago | 0

Answered
Changing Phase of a signal
Certainly you can do this with two sine wave blocks, but I guess you are not looking for this solution. What I am trying to say ...

15 years ago | 0

Answered
Breaking out from loop
It sounds like a good use case for a timer object. See <http://www.mathworks.com/help/techdoc/ref/timer.html this link>

15 years ago | 0

Answered
How to speed up the simulation?
Can you also implement the matrices through Constant block? While a simulation is running, you can double click the Constant blo...

15 years ago | 1

Answered
Can someone help me create my loops?
Not sure what do you mean exactly? Do you want to debug your code to make it run? Or do you want to vectorize to eliminate the f...

15 years ago | 0

Answered
case insensitive strfind?
use regexpi

15 years ago | 1

Answered
File import
Save your text in a file called 'test.txt' a=importdata('test.txt'); a=a(:,1:3); b=sprintf('%d%d%d\n',a') c=str2...

15 years ago | 0

| accepted

Answered
for loop
Assume the element in I is the first two columns of the element in G. %% G=[1 0 1;1 0 0;0 0 1;1 1 1]; [M,N]=size(G); ...

15 years ago | 1

Answered
compare
Probably there is no need to make I a cell array. %% G=[1 0]; I=[1 0;1 1;0 0;1 0;1 1;0 1;1 0]; Compare=ismember(I,G,'ro...

15 years ago | 0

Answered
Vector problem
neff_vec(Index)=0 doesn't delete those elements. It assign value 0 to those elements. Use neff_vec(Index)=[] to delete those ele...

15 years ago | 0

| accepted

Answered
Finding a string in a file
How about this? Open M-Editor, select menu Edit->Find file. Specify what text to find, in what files and what folder/sub-folder ...

15 years ago | 0

Answered
replacing part of a string
A={'US313384RJ03(GP)','US313384RJ03(GP)'}; A=strrep(A,'US','1032'); A=strrep(A,'(GP)','');

15 years ago | 0

| accepted

Answered
Set Ydata in Matlab, how does it work?
Plot a figure: h=plot(1:10); type get(h) to see a list of properties. You can get the data back by: y=get(h,'YData'...

15 years ago | 1

Answered
'dec2bin' produce error when converting rounded float number
We don't have your data so probably won't re-produce your error. You could check the value of i when the error happened and then...

15 years ago | 0

Answered
How can I programmatically access specific variables that are dynamically loaded?
Use fieldnames() to get your true variable names then use dynamic field name technique to get the value. VarNames=fieldname...

15 years ago | 1

| accepted

Answered
Simulink Coder- Tunable Constants Question
extern Parameters_CompileAttemp_201107 CompileAttemp_20110705_P_ It declares a variable called "CompileAttemp_20110705_P_". Its...

15 years ago | 0

| accepted

Answered
how to know how much time it takes to run the matlab code?
tic; % do stuff toc; Also, see cputime(), etime(), clock()

15 years ago | 3

| accepted

Answered
Question about MATLAB functions
Not all functions are provided with the .m source code. But you can always try, e.g. edit xlswrite.m

15 years ago | 0

Answered
Vector Manipulation
The best way is to provide some example data so we can understand your question better. Below is my guess. %% Data=(1...

15 years ago | 0

Answered
random integer generator in matlab simulink and how to set parametres ?
You can use the "Uniform Random Number" block from "Source" library. Set Min to be 0 and Max to be 3. It is not integer so you n...

15 years ago | 0

Answered
Cell array
You mean this? %% a={'xx1 xx2 xx3 xx4'}; b=regexp(a{1},'\s','split')

15 years ago | 0

Answered
Reorder a Cell arrays
Yep. This is pretty common. You need to do some processing. %% fname={'abc3.txt','abc2.txt','abc1.txt','abc10.txt','abc1...

15 years ago | 0

| accepted

Answered
Detecting gaps in time series data and replacing with NaN
Your time stamp is always incremental and the smallest gap is sp. So it might worth to take a different approach. %% Raw Data...

15 years ago | 0

Answered
Vector problem
A=rand(3,51); Index=and(A<0.8,A>0.5); A(Index)=0;

15 years ago | 0

| accepted

Answered
matlab algorithm question
When i=0, imgIFile='./caltrain/gray/caltrain000.ras' The operation is like crop an image. All rows are selected, but only col...

15 years ago | 0

Answered
Uiputfile problem - how do i tell callback which file I want it to save?
Assume you have your processed image data in a variable called ImageData (I am creating some data to explain it). The following ...

15 years ago | 0

Answered
bucketing values
Something like this: A = [0.8756 0.1185 0.0059]; RandNum=rand(1000,1); Index=2*ones(size(RandNum)); Index(RandNum<...

15 years ago | 0

Load more