Answered
calculate checksum for the input vector
In R2007b, when used in Embedded MATLAB Function, bitand() doesn't support floating-point input. The arguments must belong to an...

14 years ago | 0

Answered
ind2sub output dimension
Follow the same clue in the answer to your other question, you can do the following: %% B=rand(4,5,6); Ind=(20:25).';...

14 years ago | 2

| accepted

Answered
Matrix position stored in a variable!
%% A=magic(10); d=[2 3; 4 5; 6 7]; B=A(sub2ind(size(A),d(:,1),d(:,2))) *Update for any size of d* %% A=rand(2,3,4)...

14 years ago | 0

| accepted

Answered
A little help?
Matrix=[-0.1,0.2;-0.5,0.9] <http://www.mathworks.com/help/techdoc/learn_matlab/f2-12841.html> *Based on your latest update in ...

14 years ago | 1

Answered
xlsread to retrieve information based on input
If the data sheet is not extremely large, you can use xlsread() to read in all the data and then process it. [Num,Txt,Raw]=...

14 years ago | 0

Answered
Waitbar does not increment
Inside the for-loop, can you try adding either "drawnow" or "pause(0.2)" after the waitbar() statement? I never had problem reg...

14 years ago | 0

Answered
Cell and double data
%% Type={'Type A','Type A','Type B','Type C','Type C'}.'; Value=[100,500,1000,100,200].'; [UniType,Ind_i,Ind_j]=uniqu...

14 years ago | 0

| accepted

Answered
mex -setup doesn't seem to find my compilers?
What is the version of your MATLAB and what is your operating system. If you search your document (doc mex), you'll be able to f...

14 years ago | 1

Answered
Weekday determination
datestr(datenum(2011,12,8),'ddd')

14 years ago | 0

Answered
Generate PWM signal through Parallel port
I have doubt about the feasibility that you can use Simulink and parallel port to generate a 20kHz PWM signal in real time. But ...

14 years ago | 0

Answered
Defining column vectors for plotting from a single data source
I don't know how to choose the column using workspace GUI for plotting, but it should be easy using MATLAB command. A=magic(1...

14 years ago | 0

| accepted

Answered
charge simulation method
f=[1 2 3]; g=bsxfun(@minus,f,f.') The other question depends on how you plot it and how do you want to choose the point.

14 years ago | 0

| accepted

Answered
How to understand sample time in Simulink
It's a good question. Sample time is not particularly just for Simulink models. It's used everywhere. It's how often do you obse...

14 years ago | 1

Answered
Transforming Result to Meaningful Information
You probably mean indexing. For example Names={'John', 'Peter','Terry','Alice','Mary'}; ind=[3 1 4 2]; SelectedNames=Name...

14 years ago | 0

Answered
function to pick out number
Use this example, your second column data will be the variable "A" below. %% A=[0 0 1 2 3 4 5 0 0 0 4 5 6 7 8 0 0]; T...

14 years ago | 1

Answered
How to close all windows except top level window of a model?
You can do this: b=find_system(ModelName,'blocktype','SubSystem'); close_system(b); This will only close those opened...

14 years ago | 0

| accepted

Answered
Question about getting text from a file
I copied your text file data and removed all the "**" and "<br>" and then run the following command. It got all the data in plac...

14 years ago | 0

| accepted

Answered
concatenate matrixs
Because you have mixed numerical and string data, you have to make your variable w a cell array if you just want to run xlswrite...

14 years ago | 0

| accepted

Answered
How to change the timescale of a signal?
resample() can be used sometimes. But since your signal value is either +1 or -1, I guess you might want to resample it using th...

14 years ago | 0

Answered
How to resolve the error "cell contents reference from a non-cell array object"? Thank you!!
You have 18 lines in the text file. The variable "paramlist" got the correct value after reading the file. The variable "chanlis...

14 years ago | 0

Answered
replace elements of a vector
What's wrong with using a simple, old, straightforward for-loop? Jan will help me prove that it's faster than other approaches. ...

14 years ago | 3

Answered
actxserver cannot read all of the data
I think the problem might be that you don't have proper pre-allocation. I can understand your code. You need to plan ahead your ...

14 years ago | 0

| accepted

Answered
Matlab plot: create a line b/w the points except the last one?
x=1:10; y=1:10; plot(x(1:end-1),y(1:end-1)); hold on; plot(x(end),y(end),'+');

14 years ago | 1

Answered
Add Item to my listbox in GUI ?!
When filename is a cell array inputFileNames = [inputFileNames; filename];

14 years ago | 0

Answered
String help!?
use letter=input('Enter One letter: \n','s') to get the letter directly.

14 years ago | 0

Answered
How to overlap the polar plot in the same figure
hold on? %% t = 0:.01:2*pi; polar(t,sin(2*t).*cos(2*t),'--r') hold on; polar(t,sin(t).*cos(t),'.b')

14 years ago | 0

Answered
How can I get all simulink model block's data type without compile the modle?
In your model, click menu Format->Port/Signal Displays->Port Data Types %% f14; Blocks=find_system('f14'); f14([],[],[]...

14 years ago | 2

| accepted

Answered
GUI for a Simulink realtime workshop model setting values for gain constans etc
Go to your document, Real-Time Workshop->External Mode->Using the External Mode User Interface->Parameter Downloading, There ...

14 years ago | 0

| accepted

Answered
Reading 3rd set of data from large text file
It can be done but it will largely depends on the actual data format, data length of your file. It's really hard to make it gene...

14 years ago | 0

Answered
Stateflow controller guard conditions
"[0<Driver_Torque_Request<=0.7]" is not a valid condition. It should be "[0<Driver_Torque_Request && Driver_Torque_Request<=0....

14 years ago | 0

Load more