Community Profile

photo

per isakson


KTH

1,945 total contributions since 2010

Contact

per isakson's Badges

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

View details...

Contributions in
View by

Answered
Assigning values to an array of arbitrary dimensions in MATLAB.
"The problem I have is to be able to this with an arbitrary value of j." I think value2arrayND does that. It takes a cell array...

6 days ago | 1

| accepted

Answered
Speeding up the manipulation of large matrices
Your code, "diff(temp,[],2)==0,2)", made me think that temp holds whole numbers. If so, you could convert temp to an appropriate...

6 days ago | 0

| accepted

Answered
How can I call the variables of MATLAB workspace from a function?
Do you have a good reason for doing this? Hint: function save_base_workspace() evalin( 'base', 'save( ''save_base_works...

8 days ago | 1

| accepted

Answered
Convert an array of numbers into letters using logical indexing
Another approach >> grades = reshape([ 6.29, 5.87, 5.28, 7.38, 7.40, 4.07, 4.23, 7.25, 3.60 ... , 4.37, 4....

8 days ago | 0

Answered
How to store Data in a MATLAB® data file as a MATLAB dataset object?
I successfully (R2018b) ran the example of the documentation that you linked to. Did you try it? "MATLAB dataset object" see d...

9 days ago | 0

Answered
How to clear the workspace from within a program?
Read Base and Function Workspaces Your program is that a script or a function? Your question makes me believe your program is ...

10 days ago | 1

Answered
Windows(CR LF) to Unix (LF)
You have a few options Open the file in Notepad++ and replace CRLF by LF as shown by the screen clip below. Use the solution, ...

10 days ago | 0

| accepted

Answered
Efficiently import text file with irregular struture
See Import Block of Numeric Data from Text File and How do I parse this complex text file with textscan? If you need further...

11 days ago | 0

Answered
Getting error message, "Subscript indices must either be real positive integers or logicals."
MATLAB has indexing of arrays beginning from 1 instead of 0, thus replace for i =0:1:75 by for i =1:1:76

12 days ago | 0

Answered
How to store columns of different lengths using cells
I assume that you intend to put successive values of trimtempstoreCol into cells of newData. To do that, replace newData{t...

12 days ago | 0

| accepted

Answered
If statement correction help
"I need is to create an array of 1000 random variables from -1 to 0 and 1/2 to 1" Another approach >> X1 = rand(1,1e3)*1.5 - 1...

13 days ago | 0

Answered
I'm not sure what im doing wrong on this script...
See TUTORIAL: Why Variables Should Not Be Named Dynamically (eval) Hint: %% C.black = 0; C.brown = 1; C.red = 2; C.orange...

13 days ago | 0

Answered
string to text file
This creates a textfile, which notepadd++ opens. v1=str(:,1); v2=str(:,2); v3=str(:,3); T = table( v1,v2,v3 ); writetable(...

15 days ago | 0

| accepted

Answered
Merge same field of 36 structures
Try this %% numfiles = length(filenames); results = cell(numfiles, 1); for K = 1 : numfiles datastruct = load( filename...

16 days ago | 0

Answered
access data in table using for loop
Try something like this %% idx = {'OMFGA','MBNC'}; OMFGA = cell( 1, numel(idx) ); for ii=1:numel(idx) B = strcmp(compTi...

17 days ago | 0

Answered
How to extract values to create a table on excel?
Try >> [x,y,T] = steadyheat_jacob() where function [x,y,T] = steadyheat_jacob() %----------------------------------...

17 days ago | 0

Answered
Dependent property is shown in the variable editor even before its get method
"before I invoke its get method, its value is shown" Yes, that's is obviously the case, but I fail to find this behaviour desc...

17 days ago | 0

| accepted

Answered
Imported a large csv file into MATLAB - which output type should I choose?
"I have a table" I assume that's a text file See readtable, Create table from file

18 days ago | 0

Answered
Adding an outer for loop for a plot
This is may approach. (Don't change the code that works.) function cssm( ) eta = [ 4.0, 4.2, 4.7 ]; for e = eta ...

18 days ago | 0

Answered
choose 2 random unique element inside cell
See datasample, Randomly sample from data, with or without replacement and try >> cellfun( @(row) datasample( row, 2, 'repla...

28 days ago | 0

| accepted

Answered
Simulating a ship sailing in water wave
See: A Viking Ship

28 days ago | 1

Answered
Why is CELLFUN(@isempty) much slower than CELLFUN('isempty')?
See cellfun – undocumented performance boost

29 days ago | 1

| accepted

Question


Weird behavior when debugging code invoked by timer
This question is overtaken by Spurious fire from timer . This question is related to my question Debug code invoked by timer. ...

29 days ago | 0 answers | 0

0

answers

Answered
Hungarian algorithm realizated in matlab
Documentation on assignDetectionsToTracks: Assign detections to tracks for multiobject tracking says "[...] assigns detections ...

30 days ago | 0

| accepted

Answered
Signs in the output.
This script nearly makes it %% h = [-1 -2 0]; v = {'x','y','z'}; j = sqrt(sum(h.^2)); z = 0; while z <= 3 z = z + 1; ...

30 days ago | 0

| accepted

Answered
Retrieve strings into a structure wihin a loop
Haven't used setfield() for a long time. Which release do you use? Try this >> Storm = cssm() Storm = struct with field...

1 month ago | 0

| accepted

Answered
Sub-scripting a table
Try and replace hour20=MarchData(20==hour(MarchData.Date),:); by clock2000 = MarchData((hour(MarchData.Date)==20 & minute(Mar...

1 month ago | 0

| accepted

Answered
dlmwrite with text and numbers
Something like for jj = 1: len fprintf( fid, '___\n', num(jj), txt{jj} ) end is a standard approach Another answer is...

1 month ago | 0

| accepted

Answered
trying to change negative values to 0 and positive to 1
The problem is somewhere else >> volts_add = randn(1,6); >> volts_add( volts_add <= 0 ) = 0 volts_add = 0.5377 1.8339...

1 month ago | 0

Answered
Read files with lat Long values ?
The comma delimited list of character vectors 'H\Adrij\documents\data_','_',lat{y,1},'_',lon{y,1} must be replaced by ONE st...

1 month ago | 0

Load more