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...

3 dagen 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 dagen 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...

5 dagen 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 dagen 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' ...

6 dagen 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...

8 dagen 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...

11 dagen 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...

14 dagen 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 {'...

19 dagen 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('...

23 dagen ago | 1

| accepted

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

25 dagen 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...

27 dagen 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 dagen 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' ...

28 dagen 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 ) ...

29 dagen 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...

29 dagen 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)

29 dagen ago | 0

Answered
Matlab 2014 docking/tilling/organizing windows?

ongeveer een maand 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 ...

ongeveer een maand 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; ...

ongeveer een maand ago | 0

| accepted

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

ongeveer een maand 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...

ongeveer 2 maanden 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...

ongeveer 2 maanden 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

ongeveer 2 maanden 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...

ongeveer 2 maanden 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...

ongeveer 2 maanden 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...

ongeveer 2 maanden ago | 0

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

ongeveer 2 maanden 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...

ongeveer 2 maanden 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...

ongeveer 2 maanden ago | 0

Load more