Answered
How to direct FOR loop to next iteration when one fails - and just skip failed iteration, when compiling date in structural vectors?
Just answer the question in your title, use try() and catch() to capture the error, use continue to go to the next iteration. ...

15 years ago | 0

Answered
How to convert a .txt to a .xls?
If you don't need to process the data, there might be a different way to do it. I can open a delimited .txt file directly with E...

15 years ago | 0

Answered
SOS: How to use datenum for a vector ??
a=[20110711 20110712 20110712]; b=datenum(arrayfun(@num2str,a,'un',0),'yyyymmdd'); tenor=b-datenum('20110610','yyyymmdd')...

15 years ago | 2

| accepted

Answered
Automated concatenation of variables into matrix then separation of matrix into variables containing original variable names
It can be done but I am not sure if this is really necessary to solve your original problem. The following example assumes all y...

15 years ago | 1

| accepted

Answered
How to read a file unrecongnized to Matlab
You can use textscan() function to read it. Some other functions are textread(),dlmread(). Try it yourself first.

15 years ago | 0

Answered
How can I convert a system with delay from continuous to discrete and from discrete to continuous and the result be the same?
When you convert your continuous transfer function to discrete with sample time as 0.3, every step happens at the times of 0.3, ...

15 years ago | 1

| accepted

Answered
finding the closest values in a set of data
A = [4; 7; 13; 44; 55;]; B = [1; 3; 8; 9; 33; 45; 48; 53; 54; 66]; C=bsxfun(@minus,A,B'); [D,Index]=min(abs(C),[]...

15 years ago | 0

Answered
.MAT variables to list box
This should get you started. MatFile=uigetfile('*.mat'); MyVar=load(MatFile); VarNames=fieldnames(MyVar);

15 years ago | 0

| accepted

Answered
Chopping a wave(signal)
Can you clarify? Could be very simple. t=0:0.1:10; signal=sin(t);figure(1);plot(signal); NewSignal=signal(1:50);figur...

15 years ago | 0

Answered
how to detect vector value in sequence in stateflow
This task is not that straightforward even in Matlab. I can suggest one way to do it in Matlab. Please chime in if you have othe...

15 years ago | 2

Answered
how to move cursor to next line.
Follow <http://www.mathworks.com/matlabcentral/answers/7875-fprintf-don-t-print-newline-character this QA> to see if it can help...

15 years ago | 0

| accepted

Answered
What is your unusual use of MATLAB?
This 'Parenting Toolbox' is a great idea. It reminds me that I've made my contributions. I wrote a program to help my kids on th...

15 years ago | 1

Question


What is your unusual use of MATLAB?
I remember reading a blog (maybe by Doug Hull) that someone uses MATLAB to send emails and check local weather. I am just wonder...

15 years ago | 19 answers | 14

19

answers

Answered
Remove columns from a matrix with a loop.
You ignored the caution both Matt and I gave you in your previous question. You should not do it in the loop.

15 years ago | 0

Answered
open URL in Media Player
You should be able to use system(). You just need to specify the full path of your wmplayer.exe. I tried below and the latter wo...

15 years ago | 0

Answered
Elegant way to replicate a vector, placing it into each cell in a cell array
I am not trying to win a competition but here is the example. It looks like it will be faster to pre-allocate using hidden refer...

15 years ago | 0

Answered
Elegant way to replicate a vector, placing it into each cell in a cell array
A=[1 2 3]; mycell=cell(2,3); mycell(:)={A};

15 years ago | 0

Answered
Addpath accumulated time lags
10s sounds unreasonable. Did you actually tic toc before and after addpath() and genpath()? What do you mean "over time will slo...

15 years ago | 0

Answered
Datatype not supported by stateflow data: Data overflow
>> data1=int32(86458 ) data1 = 86458 >> data2=int32(5381838) data2 = 5381838 >> Difference = dat...

15 years ago | 1

| accepted

Answered
How can I use current path and all sub folders instead of just current path?
Or run the command addpath(genpath(MyPath))

15 years ago | 1

Answered
from .mat to .txt
Follow the related question that I asked. <http://www.mathworks.com/matlabcentral/answers/5091-save-workspace-to-m-file-feature ...

15 years ago | 0

Answered
Selectivly remove values from a matrix with a loop
Follow this example: a=1:9 a(5)=[] Please note that using this approach, you should not do it in a loop. Also follow this ...

15 years ago | 0

Answered
Problem in Signal Builder
So there is no problem on Simulink Signal Builder block. You want to create a curve like you have show in the Signal Builder blo...

15 years ago | 0

Answered
gnerates number that has digits from 1 to 9 are not repeated
My first answer to this question didn't really work as I imagined. Here is a confirmed answer. I reduced the number 9 to 3 to sh...

15 years ago | 0

Answered
Using Legend
In your example, if you have legend('a','b','c','d','e','f'), you'll have the right legend. The problem is that you have 6 curve...

15 years ago | 0

Answered
How to Sort a matrix and a vector?
Try this: a=eye(5); b=randperm(5); c=a(b,:); time(logical(c))=P;

15 years ago | 0

| accepted

Answered
Using Legend
Look at the example in the document <http://www.mathworks.com/help/techdoc/ref/legend.html here>. The legend should have the sam...

15 years ago | 0

| accepted

Answered
Load a variable in workspace from a Function
You need to clarify your question. Do you mean Matlab base workspace? You could declare the variable as global. However, many p...

15 years ago | 0

| accepted

Answered
gnerates number that has digits from 1 to 9 are not repeated
Use the perms() function. I need to confirm later whether the last two lines have the right syntax. a=perms(1:9); b=char...

15 years ago | 0

Answered
Function returning two vectors
People do that everyday using Matlab. Copy the following into a file called MyFun.m function [y1,y2]=MyFun(x1,x2) % inp...

15 years ago | 3

| accepted

Load more