Community Profile

photo

per isakson


Last seen: Today

KTH

2,381 total contributions since 2010

Contact

per isakson's Badges

  • Revival Level 3
  • Ace
  • 36 Month Streak
  • Leader
  • Speed Demon
  • Promoter
  • Personal Best Downloads Level 2
  • Editor's Pick
  • First Review
  • 5-Star Galaxy Level 4
  • First Submission
  • Thankful Level 3
  • Knowledgeable Level 4
  • First Answer
  • Commenter

View all

Contributions in
View by

Answered
How do you import specific rows of numeric data (without text) for the file I have attached?
Maybe not the most rubust way, but it does the job. (The numerical blocks must be followed by non-numerical text.) %% ffs = '1...

1 day ago | 0

| accepted

Answered
How to Speedup conditional vector elements replacement?
There is a Matlab function, repelem, that does it. >> repelem( b, a ) ans = Columns 1 through 13 1 6 6 6 ...

1 day ago | 0

| accepted

Answered
Create all combination of strings
See: perms, All possible permutations In response to comment Does the function, cssm(), do what you ask for? >> all_permuta...

2 days ago | 0

Question


How to edit and replace comments on File Exchange submissions?
It's a hidden algorithm that controls what happens when I write comments on my submissions at File Exchange. I failed to find a ...

3 days ago | 0 answers | 0

0

answers

Answered
Speed up code:: Code is working but slow..
See: Profile Your Code to Improve Performance and Techniques to Improve Performance

11 days ago | 0

Answered
How do I use numerical and logical indices to get this output?
One out of many ways %% myArray = [2, 4, -3, 6, 9]; isneg = myArray < 0; myArray( isneg ) = 1;

11 days ago | 1

Answered
Change [ ] cells in .mat file to NaN
I don't fully understand your question. See: TUTORIAL: how to ask a question (on Answers) and get a fast answer "The code bel...

12 days ago | 0

Answered
How do I append a row average to a new matrix
With a little bit of guessing. Does this answer your question? %% foo = randi(500,500); cac = mat2cell( foo, 5*ones(100,1), 5...

14 days ago | 1

| accepted

Answered
Preventing too many function inputs
>> exfunction(1,3,9,4,5) throws the error Error using exfunction Too many input arguments. I assume that's the error you e...

14 days ago | 0

Answered
MATLAB Answers Wish-list #5 (and bug reports)
Activity Feed: "See more" asks for "See less".

22 days ago | 1

Answered
How to modify few numbers in a random text file?
Try this %% chr = fileread('model_v2.txt'); ffs = 'model_out.txt'; fid = fopen( ffs, 'w' ); [~] = fprintf( fid, chr, 1.2, 3...

1 month ago | 0

Answered
How to replace elements of a cell array using a containers.Map
With string and arrayfun on R2018b %% names_to_replace = ["TonnageDeBSA", "D__bitD___eauAuBSA", ... "Pres...

1 month ago | 0

Answered
How can I keep asking the user for correct input even after they press enter?
Use strcmpi( Ready, 'ready' ) instead of Ready== 'ready' | Ready== 'Ready' Don't use == in combination with character array...

1 month ago | 1

Answered
How can I concatenate multiple CSV file and turn into one CSV file
A alternate idea (that wrongly(?) concatenates the the files vertically) Pro avoids converting to numerical and back to text (...

1 month ago | 0

| accepted

Answered
Changing the values of a column in a table.
This statement does it tbl.t = tbl.t(ones(height(tbl),1)); % once refered to as "Tony's trick" Example: %% Create a sampl...

1 month ago | 1

Answered
How to replace specific text in .csv file
Another approach, which avoids conversion to numerical and back to text. (And, I think, works with R2006 and later releases.) %...

1 month ago | 1

| accepted

Answered
Question about accessing data in a nested struct
It is impossible (for me) to help based on the little information that you provide. Here (R2018b) it works fine. >> sas = xml_...

1 month ago | 0

| accepted

Answered
How do I set a class property?
This might help as a start >> vec = vector; >> vec.v1 ans = 120 >> where classdef vector properties v1 ...

1 month ago | 0

| accepted

Answered
Unknown File/Folder in directory
"What does this mean, I dont Understand." I assume that you refer to 34 and 36, respectively. Main_File is a struct array with...

1 month ago | 0

| accepted

Answered
Select Specific NC Files in Folder Using Date Included in Filename
Something like this should do it matrix = [ 6, 4, 1980 6, 4, 1981 ]; dates = string( datestr( [matrix(:,[3,1,2...

1 month ago | 1

Answered
clarification in for loop with intervals
Someting like this %% indicies = {[55:1:65], [125:1:145], [201:1:225]}; for jj = 1 : numel( indicies ) for kk = indicies...

2 months ago | 0

| accepted

Answered
How to add an element to cell?
One way >> the_cell={'January','March','April'}; >> the_cell = cat( 2, the_cell(1), {'February'}, the_cell(2:end ) ) the_cell...

2 months ago | 0

| accepted

Answered
how to change the number that decreases in the array element to the same number, for example 0 (zero)
Is something like this what you are asking for? %% a = [100.001469926008 0.0140073495254864 0.00452326089811489 ... ...

2 months ago | 0

Answered
Why I get this error for my code?Error: File: Untitled2.m Line: 10 Column: 8
Replace x2=x1. / max(x1); by x2=x1 ./ max(x1); Be careful with where you add spaces

2 months ago | 1

| accepted

Answered
Convert char to variable
"by means of OOP, to create an app" Object Oriented Design isn't easy and there are many different solutions to a problem. I ...

2 months ago | 0

| accepted

Answered
Importing Data from Text File Loop
First you need to create an array of file specifications. I prefer to use the function dir() glob = fullfile( "C:\Users\nperson...

2 months ago | 0

Answered
Extending the number of terms in a specific sequence.
A copy&paste mistake: synth_f1 = synth_f1 - (1/(n*n))*sin(n*w*t) + (1/((n+2).^2))*sin((n+2)*w*t); % ...

2 months ago | 1

Answered
Accessing subclass methods from abstract superclass
This is not what you ask for, but close. (I don't think what you want is possible with Matlab.) >> child = ChildClass(); >> ch...

2 months ago | 1

Answered
Best way to truncate imported data so the plot displays the area of interest
One simple interactive way (R2018b) %% some data noise = rand( 0.5e6, 1 ); roi = 4.5*sin( (1:5e3)/(20*pi) )'; data = [ noi...

2 months ago | 0

| accepted

Answered
Import hours from a excel file
It can be done with https://se.mathworks.com/help/matlab/ref/duration.html. , but that requires more reading of the documentatio...

3 months ago | 0

Load more