Community Profile

photo

per isakson


KTH

2,050 total contributions since 2010

Contact

per isakson's Badges

  • Revival Level 3
  • Ace
  • 36 Month Streak
  • Thankful Level 3
  • Knowledgeable Level 4
  • First Answer
  • Leader
  • Speed Demon
  • Promoter
  • Commenter
  • Solver

View details...

Contributions in
View by

Answered
What frustrates you about MATLAB?
Background While experimenting with a function, which I had downloaded from FEX, I encountered the error No such file or dire...

4 days ago | 0

Answered
What's the best way to open and read a .out file in MATLAB?
If the file contains columns of data, you may want to try the interactive tool Import Data Notice that this tool can generat...

5 days ago | 0

Answered
Is there a way to continue operation during input()?
Something like %% a script named cssm.m while true user_input = waitinput( 'prompt: ', 5, 's' ); if isnan( user_inp...

6 days ago | 0

Answered
how to re-assign variable within for loop
A long shot. Replace table=[data1;data2] by if i == 0 table = data1; end table = [table;data2]; %#ok<AGROW> data1 = ...

6 days ago | 0

| accepted

Answered
How to use textscan on a cell array without a loop?
Am I on the right track? Run %% mystruct.out = { '%ACCDA,50,123.99,W,07512.001,E,2,11,2.2,1002.2,Z,,,,*22' ...

7 days ago | 1

Answered
How to replace values above a given percentile by nans
Ignore the NaNs explicitely when calculating the percentile. Try %% % Table with nan t = array2table(vertcat(horzcat([1:1000...

9 days ago | 0

Answered
how to access abstract class in matlab
I'm not sure, I exactly understand what you mean. However, I try "how can I access this abstract class" You cannot "access" an...

12 days ago | 0

| accepted

Answered
Updation of Cell Array
Is something like this what you are looking for? I don't quite understand what you tried. Try this code %% Sample data cell...

15 days ago | 0

| accepted

Answered
how to assign multiple strings to single variable
Try >> jan = arrayfun( @(num) sprintf('jan_%4d',num), (1958:2018), 'uni',false ); >> jan(1:3) ans = 1×3 cell array {'...

20 days ago | 0

| accepted

Answered
Reading a complex text file and building a matrix
Try this %% chr = fileread( 'example.txt' ); clusters = strsplit( chr, '--- detector1 ---\r\n' ); clusters(1) = []; clear('...

24 days ago | 1

| accepted

Answered
How to remove 'middle' elements from a vector?
Try A( A>=2 & A<=7 ) = []; and see Logical indexing

26 days ago | 1

| accepted

Answered
Sorting a structure array
Hint: This script sorts with regard to the leading group of digits (converted to numeric) %% SubFold = { '1._0.005._0.2_.4._2...

28 days ago | 1

| accepted

Answered
using fprintf for answers
This supplements Walter's answer. Replace fprintf('\r\r%s\n', 'Strain Tensor\n') by fprintf('\r\r%s\n', 'Strain Tensor') ...

28 days ago | 1

Answered
specific pattern from the file name
These statements %% chr = 'abcdd-22_Z12'; cac = regexp( chr, '(?<=_)Z\d{2}', 'match' ); cac{:} return ans = 'Z12' ...

29 days ago | 0

| accepted

Answered
Creation of a text file with a series of record set
Try cssm1() dbtype test.txt 1:14 where function cssm1() fid = fopen( 'test.txt', 'w' ); assert( fid >= 3 ) ...

1 month ago | 0

| accepted

Answered
Help With For Loops in Plotting Problem
Either should work. I prefer to keep plot() outside the loop because of speed. That requires to make c_t a matrix, which in tu...

1 month ago | 0

Answered
could anyone help me how to solve the issue in the following code
Replace y=diff(rows1) by y(k)=diff(rows1)

1 month ago | 0

Answered
Matlab 2014 docking/tilling/organizing windows?

1 month ago | 1

| accepted

Answered
"Undefined function or variable 'imsplit'."
Maybe Imsplit, Split image or matrix into subparts using simple syntax by Jurgen. (Created with R2008a) of the File Exchange ...

1 month ago | 1

Answered
Why do I get an "Invalid value returned."-error when assigning a string property inside a loop using v18b?
The syntax of your properties definitions properties( SetAccess = protected ) test_str@string as vector; ...

1 month ago | 0

| accepted

Answered
Group and individual means
Try this YSA1 = Y(Sub==1&A==1); SubMean = mean (YSA1);

2 months ago | 0

| accepted

Answered
is it a bug?
I call this a bug. My comments The old function, str2num(), uses eval() to do the conversion. "Eval is evil" or at least tric...

2 months ago | 2

| accepted

Answered
Save data from while loop
Your script overwrites x,y,z for each iteration. You need to assign vectors of appropriate length to x,y,z , (preallocate) befor...

2 months ago | 1

Answered
how do i set a threshold on the values of the indices in my matrices for my entire code?
Try this M(abs(M)<=1e-9) = 1e-9; where M is a matrix. And see Indexing with Logical Values

2 months ago | 0

| accepted

Answered
Possible to regexp a file with a for loop using expressions from an array?
I'm not sure that I fully understand your question. However, try this script %%-section by section %% txt = fileread( 'cssm.tx...

2 months ago | 0

Answered
Long loading time of a 60 MB matrix
"loading a 60MB matrix took an average of 100.3 seconds" >> tic, S=load('h:\m\cssm\110.mat'); toc Elapsed time is 25.627453 se...

2 months ago | 1

| accepted

Answered
Help!!! how to search for some xx xx xx xx(hex) in a dat file very fast!!!
Your question is very vaque and leaves room for interpretation. I assume that dat-file is an ordinary text file. I cannot gues...

2 months ago | 0

Answered
Convert String Array to Numeric matrix and string array
Try this %% data_events = [ "1" "60" "" "" "" "" "" "" "" "" "...

2 months ago | 0

Answered
Could someone explain what the code means
Comments on your code fragment the end of the for-loop is not shown, thus it is not clear how the value of functione is used f...

2 months ago | 0

Answered
how to run my conversion program using loops
Try this %% main_folder = 'c:\whatever\mainfolder'; sad = dir( fullfile( main_folder, '**', '*.wav' ); sad = reshape( sad, 1...

2 months ago | 0

Load more