Answered
save an image in a directory
Why not use print() directly. print('-dtiff',fullFileName)

15 years ago | 0

| accepted

Answered
Change time function tic, toc
It does happen and there might be reason for it. # Your algorithm might have different number of operations, such as if-else ...

15 years ago | 0

| accepted

Answered
plot pause
Nice work! I recommend you making a generic function which includes mostly the code in your while-loop. This generic function ca...

15 years ago | 1

Answered
iqr error "Undefined function or method 'iqr' for input arguments of type 'double'."
I got the same error message when I didn't got the license for the toolbox. You need to use license('inuse') to see if you have ...

15 years ago | 0

Answered
using .mat and .m files in GUI
a=load('datafile.mat'); VarName=fieldnames(a); will give you all the variable names in datafile.mat. Then, select a vari...

15 years ago | 0

Answered
ascii
double('A') double('0') char(65) char(55)

15 years ago | 0

Answered
Model predictive control toolbox implementation on dSpace board
It's more of a dSPACE question. Contact dSPACE tech support asking about that error: Parameter number mismatch (501). Might i...

15 years ago | 0

Answered
How to use a combination of dedicated and floating licenses
See my answer on this post. <http://www.mathworks.com/matlabcentral/answers/11724-can-group-licenses-and-concurrent-licenses-be-...

15 years ago | 2

Answered
Color text based on a variable
x=1:10; y=1:10; c=1:10; chem={'H','He','Li','Be','B','C','N','O','F','Ne'}; h=figure(1); xlim([0 11]);ylim([0 1...

15 years ago | 0

| accepted

Answered
Contour map from X,Y,Z Columns
You need to re-organize your data. Maybe like this: data=[... 0 0 8687 70 0 8522 45 ...

15 years ago | 0

| accepted

Answered
Logged signal data not being saved with the save command
When you use simOut=sim(), simOut only contains the data for the returned time vector. If you want to save the logged data, you ...

15 years ago | 0

Answered
MATLAB Uses 100% CPU all time
Wow! You give me caution that I'd better not to install the latest and greatest MATLAB on my old laptop! Are you running any cod...

15 years ago | 0

Answered
Ploting the data as a colormap?
You have so little data. Maybe something like this: %% x=[100 100 200 200]; y=[1 5 5 1]; z=[1114.8 826 1370.4 1711.6 ];...

15 years ago | 0

| accepted

Answered
Loop to change .m file to .mat file
First of all, you have to understand that .m file is a text file. It could be a m-script file or a m-function file. The .mat fil...

15 years ago | 0

| accepted

Answered
Save file .txt in desktop
[File,Folder]=uiputfile; dlmwrite(fullfile(Folder,File),A,'delimiter',' ','newline','pc');

15 years ago | 0

| accepted

Answered
Prase a sequence (of existing and not existing) folders
help exist EXIST('A','dir') checks only for directories. break() can terminate a for-loop. continue() passes control to the n...

15 years ago | 0

| accepted

Answered
cell contents in a loop_fangjun's answer
You need to change the last part of the code as below. Index=false(size(files)); for j=1:size(files,1) for k=1:size(fi...

15 years ago | 1

| accepted

Answered
extracting digits from a number
a=[1234;12345678;3456]; b=num2str(a); c=b(:,5:6) d=b(:,7:8) e=str2num(c) f=str2num(d)

15 years ago | 2

| accepted

Answered
How to execute at a specific time?
use timer object. See example in help timer.

15 years ago | 1

Answered
finding last non-zero value from column
%% M = [ 1 1 1 1 1 1 ; 1 1 1 0 0 0 ; 1 1 0 0 0 0 ; 1 0 0 0 0 0; 0 0 0 0 0 0 ]; n=M~=0; [dummy,Index]=sort(n); Index=In...

15 years ago | 1

| accepted

Answered
Evaluating an expression in terms of x:
x=pi; y=tan(2*x-pi*45/180) z=sin(pi*30/180-3*x) All the functions tan(), sin(), cos() etc use radius, you need to con...

15 years ago | 0

Answered
cell2mat error
Probably the numeric elements of the cell array are not the same size. See example: a={1 2;3 4} b=cell2mat(a) c={...

15 years ago | 0

Answered
Modifying a string
Use strjust(). a={'777T','123456','23A'}; b=char(a(:)); c=strjust(b,'right'); d=cellstr(c); e=strrep(d,' ','0')...

15 years ago | 0

| accepted

Answered
Sample time setting for high frequency systems
A 100kHz signal means its period is 10us. If the signal is a sine wave, you would need about 20 data points to represent a compl...

15 years ago | 0

Answered
finding files in a directory
Files=dir(['a',x{k},'.txt.*']) When you reference cell array, you need to use {}, not ().

15 years ago | 0

Answered
CAN Packing and unpacking blocks - how do I set parameters programmatically?
I know what you mean exactly. I once had a need to modify some customized block parameters through scripting. But the modificati...

15 years ago | 0

| accepted

Answered
how do i create a dataset and save it. i need to create one with different types of data (char, double, int, T/F, etc.). how do i also save it and edit it for modification?
%% CharVar={'a';'b';'c'}; DoubleVar=rand(3,1); LogicalVar=false(3,1); DS=dataset(CharVar,DoubleVar,LogicalVar); ...

15 years ago | 0

Answered
matlab error
The following will cause the same error. Check the size of your variable Best_Predicted_Frame_mov and the value of variable c. ...

15 years ago | 0

Answered
Recursive Least Square Estimation for Simple Linear Regression
I am not sure if this post will give you some clues. <http://www.mathworks.com/matlabcentral/answers/13487-is-there-something...

15 years ago | 0

Answered
How to plot scatter graph in matlab?
The function you are looking for is scatter3. help scatter3 for details and example. The other function might be mesh(),surf() a...

15 years ago | 0

Load more