Community Profile

per isakson

KTH

2,234 total contributions since 1999

• ﻿
• ﻿
• ﻿
• ﻿
• ﻿
• ﻿

View details...

Contributions in
View by

how to extract file name
If I got you question right cac = { '0101.txt', '0103.txt', '3001.txt', '3003.txt' }; out = regexp( cac, '^\d{2}', 'matc...

21 hours ago | 0

| accepted

Remove columns for a cell array
One way >> cac = cell(10,3000); >> cac = cac(:,1:end-1000); >> size(cac) ans = 10 2000 >> ...

23 hours ago | 0

| accepted

Calling a Function From Another Function
M = table_1( data ); food( M ); or food( table_1( M ) ); The two line construct is easier to debug where...

4 days ago | 0

Is there a toolbox for statistical energy analysis?
See * <http://www.ta.chalmers.se/research.php?page=sealab SEAlab is a free Statistical Energy Analysis (SEA) code implemente...

6 days ago | 1

I want to make the following row matrix looks like a matrix with rows and columns.
Column major A = [ 296, 2, 47, 296, ... ]; B = reshape( A, 3,4 ); C = permute( B, [2,1] ) outputs C = 2...

7 days ago | 0

help with regexpi expression match
One expression * 'chromosome' followed by anything up till ':' and one ':' * capturing group of one or more letter, digit, u...

8 days ago | 0

How to empty 1 cell of a cell variable which is part of a file?
*_"How to empty 1 cell of a cell variable"_* &nbsp; What exactly do you mean by _empty_? The syntax you use make me think you wa...

10 days ago | 0

How to split into different tables a multi-level cell?
*_"final goal is to have a 428x11 table"_* Study this %% data = { {'name1',1,2,3,4,5,6,7,8,9,0} ...

10 days ago | 1

| accepted

* *|dlmwrite|* writes to a text file. That's the purpose and you cannot avoid it. * _"matrix AA [...] BB"_ &nbsp; see <https://...

11 days ago | 0

How EFFICIENTLY to extract multiple column base on multiple condition
Your text make me think you want r = s.c2(:,s.state) or possibly r = num2cell( s.c2(:,s.state) ) but your code...

12 days ago | 0

| accepted

Once more... Avoid global variable!

13 days ago | 0

How to EFFICIENTLY name multiple tables located inside a different cells
To solve the first problem, replace the cellfun statement by ddTrans = cellfun( @(v,m) array2table(m,'VariableNames',v) ...

16 days ago | 0

| accepted

How can I do the following with MATLAB Editor
# Unknown in the Matlab world. Who would want that ;-) # Good question. See <https://se.mathworks.com/help/matlab/matlab_env/...

18 days ago | 1

| accepted

Define regularExpression for Strsplit?
I've understood the question differently str = fileread( ... ); [ data_blocks, headers ] = strsplit( str, '(?m-s)^abc\...

20 days ago | 0

| accepted

Object array: modify properties of a single element
This is a bit tricky. You have created an array of ten object handles to the same underlying object. Thus, a change of the value...

20 days ago | 0

long title problem printing
Two lines title({'First line';'Second line'}) Smaller font size h = title( 'abc' ) h.FontSize = 9; And Walter...

27 days ago | 0

How do I dynamically generate a variable name for individual saving of temporary data into separate MAT files?
Doc on *|save|* says: Save the fields of structure s1 as individual variables in a file called newstruct.mat. sav...

27 days ago | 1

| accepted

Functions as function inputs with specified inputs
* See <https://se.mathworks.com/help/matlab/matlab_prog/creating-a-function-handle.html Create Function Handle>. Very useful and...

28 days ago | 1

Parse text file???

29 days ago | 1

| accepted

textscan 4th row into one string
One way using *|textscan|* fid = fopen( 'U:\EMC\SMI8A_75_FA.csv', 'r' ); result = textscan( fid, '%s', 1, 'headerlines',...

1 month ago | 0

| accepted

How to sort strings by lenght?
Without using a cell array >> A = ['adam ' 'bertil' 'cesar ' 'Ada ' 'berit '...

1 month ago | 0

Matching based on the first word
Yes, try this match = cssm() match = 0 1 0 0 0 0 0 0 1 A_list items o...

1 month ago | 1

Code takes forever to run and will never fully execute? Any tips to get it to run faster?
The profiler, which you call in the beginning of the script, tells you loud and clear to preallocate sevaral variables. See <htt...

1 month ago | 0

For loop not working properly
Your code is sluggish. Preallocating variables, which the Code Analyzer proposes, would improve speed. * I put your code in a...

1 month ago | 0

How to solve the error in this code??
The error is caused by xor( Xd, Ud(:,end) ) The R2017b doc on *|xor|* says Input arrays, specified as scalars, vect...

1 month ago | 0

| accepted

Folks: My program (below) does not return an error message, it does open a plot window, but no graph/data is plotted. I am not sure why. Thank you for your help. H Daniel
Plotting *one* value at a time as line doesn't work. Line is default. Two values are needed to make a line. Replace plo...

1 month ago | 0

| accepted

* _"I am a PhD student and working on some traffic counting cards, the card has around 2900 rows ..."_ &nbsp; (excerpt from one ...

1 month ago | 0

| accepted

Error in storing the output of sprintf in a cell array
>> a{1}=sprintf('%s',name) Cell contents assignment to a non-cell array object. because *|a|* is assigned a string cons...

1 month ago | 0

| accepted